Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: X10 2.1.1
-
Fix Version/s: X10 2.2
-
Component/s: X10 Compiler: Front-end Typechecking
-
Labels:None
-
Number of attachments :
Description
The following code fails to compile with -STATIC_CALLS:
public class DefaultConstructorBug { public static def bar(y:Int):Foo{self.x==y} = new Foo(y); public static class Foo(x:Int) { } }
It produces the following error:
./DefaultConstructorBug.x10:2: Cannot return expression of given type.
type: DefaultConstructorBug.Foo{self!=null}
desired Type:DefaultConstructorBug.Foo{self.x==y}
If the order of the declaration of class Foo and the declaration of bar() is switched, the program compiles with no errors, which points to type inference as the culprit.
Issue Links
- is depended upon by
-
XTENLANG-2584
X10 2.2 frontend issues (umbrella)
-
- relates to
-
XTENLANG-1630
Compiler internal error message appears as regular compilation error
-
-
XTENLANG-1763
Auto-generated ctor for classes with properties doesn't handle inheritance
-
- supercedes
-
XTENLANG-1924
Auto-generated ctor for classes with properties doesn't have the most exact return type
-
defer all non-critical 2.1.2 issues to 2.2.