Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: X10 2.0.0
-
Fix Version/s: X10 2.0.1
-
Component/s: Language Specification, X10 Compiler: Front-end
-
Labels:None
-
Number of attachments :
Description
This example is based on one from 4.13.3, on type arguments.
package pest.ch4.inference; import pest.*; import bard.*; import x10.util.*; import pest.glob; public class TypeInference3 extends pest.Pest { public static def main(Rail[String]){ val p:Pest! = new TypeInference3(); x10.io.Console.OUT.println("Testing TypeInference3"); p.run(); } public def test() { val set1 : Set[Int] = null; val set2 : Set[set1.T] = null; val a = onion(set1, set2); } def onion[T] (a:Set[T], b:Set[T]):Set[T] = a; // bad union. }
I dunno exactly what it should do (the manual says "it is acceptable"), but I'm pretty sure the following isn't it:
/Users/bard/x10/pest/pest-cases/pest/ch4/inference/TypeInference3.x10:15: non-static type members not implemented
1 error.
Exception in thread "main" polyglot.util.InternalCompilerError: /Users/bard/x10/pest/pest-cases/pest/ch4/inference/TypeInference3.x10:15,21-26: non-static type members not implemented
at x10.ast.X10AmbTypeNode_c.disambiguate(X10AmbTypeNode_c.java:142)
at polyglot.ast.JL_c.disambiguate(JL_c.java:137)
at polyglot.visit.TypeChecker.leaveCall(TypeChecker.java:105)
at polyglot.visit.ErrorHandlingVisitor.leaveCall(ErrorHandlingVisitor.java:141)
at polyglot.visit.ErrorHandlingVisitor.leave(ErrorHandlingVisitor.java:279)
at polyglot.visit.ContextVisitor.leave(ContextVisitor.java:140)
at polyglot.visit.NodeVisitor.visitEdgeNoOverride(NodeVisitor.java:258)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:217)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.Node_c.visitList(Node_c.java:239)
at x10.ast.AmbMacroTypeNode_c.typeCheckOverride(AmbMacroTypeNode_c.java:294)
at polyglot.ast.JL_c.typeCheckOverride(JL_c.java:161)
at polyglot.visit.TypeChecker.override(TypeChecker.java:41)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:214)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.LocalDecl_c.visitChildren(LocalDecl_c.java:134)
at polyglot.ast.JL_c.visitChildren(JL_c.java:45)
at x10.extension.X10Del_c.visitChildren(X10Del_c.java:123)
at polyglot.visit.NodeVisitor.visitEdgeNoOverride(NodeVisitor.java:251)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:217)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.Node_c.visitList(Node_c.java:239)
at polyglot.ast.AbstractBlock_c.visitChildren(AbstractBlock_c.java:72)
at polyglot.ast.JL_c.visitChildren(JL_c.java:45)
at x10.extension.X10Del_c.visitChildren(X10Del_c.java:123)
at polyglot.visit.NodeVisitor.visitEdgeNoOverride(NodeVisitor.java:251)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:217)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.TypeCheckFragmentGoal.runTask(TypeCheckFragmentGoal.java:51)
at x10.ast.TypeCheckReturnTypeGoal.runTask(TypeCheckReturnTypeGoal.java:22)
at polyglot.frontend.Scheduler.runPass(Scheduler.java:325)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:102)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at x10.ast.UnknownTypeNode_c.disambiguate(UnknownTypeNode_c.java:53)
at polyglot.ast.JL_c.disambiguate(JL_c.java:137)
at polyglot.visit.TypeChecker.leaveCall(TypeChecker.java:105)
at polyglot.visit.ErrorHandlingVisitor.leaveCall(ErrorHandlingVisitor.java:141)
at polyglot.visit.ErrorHandlingVisitor.leave(ErrorHandlingVisitor.java:279)
at polyglot.visit.ContextVisitor.leave(ContextVisitor.java:140)
at polyglot.visit.NodeVisitor.visitEdgeNoOverride(NodeVisitor.java:258)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:217)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at x10.ast.X10MethodDecl_c.typeCheckOverride(X10MethodDecl_c.java:922)
at polyglot.ast.JL_c.typeCheckOverride(JL_c.java:161)
at polyglot.visit.TypeChecker.override(TypeChecker.java:41)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:214)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.Node_c.visitList(Node_c.java:239)
at polyglot.ast.ClassBody_c.visitChildren(ClassBody_c.java:63)
at polyglot.ast.JL_c.visitChildren(JL_c.java:45)
at x10.extension.X10Del_c.visitChildren(X10Del_c.java:123)
at polyglot.visit.NodeVisitor.visitEdgeNoOverride(NodeVisitor.java:251)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:217)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.ClassDecl_c.typeCheckBody(ClassDecl_c.java:415)
at x10.ast.X10ClassDecl_c.typeCheckOverride(X10ClassDecl_c.java:634)
at polyglot.ast.JL_c.typeCheckOverride(JL_c.java:161)
at polyglot.visit.TypeChecker.override(TypeChecker.java:41)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:214)
at polyglot.ast.Node_c.visitChild(Node_c.java:179)
at polyglot.ast.Node_c.visitList(Node_c.java:239)
at polyglot.ast.SourceFile_c.visitChildren(SourceFile_c.java:116)
at polyglot.ast.JL_c.visitChildren(JL_c.java:45)
at x10.extension.X10Del_c.visitChildren(X10Del_c.java:123)
at polyglot.visit.NodeVisitor.visitEdgeNoOverride(NodeVisitor.java:251)
at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:217)
at polyglot.ast.Node_c.visit(Node_c.java:183)
at polyglot.frontend.VisitorGoal.runTask(VisitorGoal.java:45)
at polyglot.frontend.Scheduler.runPass(Scheduler.java:325)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:102)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.AbstractGoal_c.run(AbstractGoal_c.java:49)
at polyglot.types.LazyRef_c.get(LazyRef_c.java:45)
at polyglot.frontend.Scheduler.attempt(Scheduler.java:237)
at polyglot.frontend.Scheduler.runToCompletion(Scheduler.java:174)
at polyglot.frontend.Scheduler.runToCompletion(Scheduler.java:160)
at polyglot.frontend.Compiler.compile(Compiler.java:166)
at polyglot.frontend.Compiler.compileFiles(Compiler.java:134)
at polyglot.main.Main.start(Main.java:119)
at polyglot.main.Main.start(Main.java:74)
at polyglot.main.Main.main(Main.java:166)
~/x10/pest/pest-cases/pest/ch4/inference:
The syntax Set1[set1.T] is not supported. Type parameters are parameters not members (selectable via dots) – that was an old design.
Let me know if there is some text in the ref manual which makes you believe otherwise.
(Fixing the ICE.)