Summary: | [1.5][compiler] StackOverflow in compiler | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Adam Kiezun <akiezun> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.2 M6 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Adam Kiezun
2006-01-05 11:41:19 EST
Are you really writing such code ? <g> nope, and actually I didn't come up with this example myself. I saw it in a paper. :) Interestingly, javac has the same flaw: D:\eclipse\workspaces\dev3.2\plugins\Crap\src>javac X.java -d ..\bin The system is out of resources. Consult the following stack trace for details. java.lang.StackOverflowError at com.sun.tools.javac.code.Types$LowerBoundFcn.visitType(Types.java:119) at com.sun.tools.javac.code.Type$Visitor.visitClassType(Type.java:970) at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:482) at com.sun.tools.javac.code.Types.lowerBound(Types.java:112) at com.sun.tools.javac.code.Types$IsSubTypeFcn.visitClassType(Types.java:410) at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:482) at com.sun.tools.javac.code.Types$IsSubTypeFcn.isSubType(Types.java:347) at com.sun.tools.javac.code.Types$IsSubTypeFcn.visitType(Types.java:387) at com.sun.tools.javac.code.Type$Visitor.visitTypeVar(Type.java:975) at com.sun.tools.javac.code.Type$TypeVar.accept(Type.java:807) at com.sun.tools.javac.code.Types$IsSubTypeFcn.isSubType(Types.java:347) at com.sun.tools.javac.code.Types.isSubTypeNoCapture(Types.java:331) at com.sun.tools.javac.code.Types$ContainsTypeFcn.visitArgumentType(Types.java:881) at com.sun.tools.javac.code.Type$ArgumentType.accept(Type.java:367) yes, it's javac bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6207386 the problem is that apparently java's type system is undecidable: see http://www.cis.upenn.edu/~stevez/papers/MZ06.pdf section 3.2 shown by reduction from subtyping in full F_<: which is known to be undecidable When checking 'f' local definition, compiler must ensure type of 'x' is compatible with type of 'f', i.e. : X <: Foo<? super X> which holds iff: Foo<Foo<? super X>> <: Foo<? super X> // using lower bound of X on lhs which is true, providing type arguments satisfy: Foo<? super X> <= ? super X using 4.5.1.1, it is true iff: X <: Foo<? super X> back to square one Added GenericTypeTests#test887-891 Released Kent's cache for compatibility checks on ReferenceBinding. Fixed Verified for 3.2 M6 using build I20060327-0010 |