Community
Participate
Working Groups
Created attachment 90589 [details] Tarball of source code that fails to compile Build ID: M20071023-1652 Steps To Reproduce: Untar the attached code, create a Java project for it, and note the type mismatch compile errors indicating identical types: The method put(Sequence.Pos, Parser<Token,NodeType>.Table.State<Token>) in the type HashMap<Sequence.Pos,Parser<Token,NodeType>.Table.State<Token>> is not applicable for the arguments (Sequence.Pos, Parser<Token,NodeType>.Table.State<Token>) sbp/src/edu/berkeley/sbp Parser.java line 467 Type mismatch: cannot convert from element type edu.berkeley.sbp.Parser<Token,NodeType>.Table.State<Token> to edu.berkeley.sbp.Parser<Token,NodeType>.Table.State<Token> sbp/src/edu/berkeley/sbp Parser.java line 206 Type mismatch: cannot convert from element type edu.berkeley.sbp.Parser<Token,NodeType>.Table.State<Token> to edu.berkeley.sbp.Parser<Token,NodeType>.Table.State<Token> sbp/src/edu/berkeley/sbp Parser.java line 240 Type mismatch: cannot convert from Parser<Token,NodeType>.Table.State<Token> to Parser<Token,NodeType>.Table.State<Token> sbp/src/edu/berkeley/sbp Parser.java line 194 Type mismatch: cannot convert from Parser<Token,NodeType>.Table.State<Token> to Parser<Token,NodeType>.Table.State<Token> sbp/src/edu/berkeley/sbp Parser.java line 197 Type mismatch: cannot convert from Parser<Token,NodeType>.Table.State<Token> to Parser<Token,NodeType>.Table.State<Token> sbp/src/edu/berkeley/sbp Parser.java line 455 This code compiles without error under javac (JDK 1.6.0_04). More information: The project that fails to compile is SBP: the Scannerless Boolean Parser (http://research.cs.berkeley.edu/project/sbp/). The latest snapshot is available using darcs: 'darcs get http://research.cs.berkeley.edu/project/sbp/edu.berkeley.sbp/'. The license is BSD, so I'm attaching the tarball of the version the demonstrates this bug.
Karice - is the BSD licensed source code ok for me to look at ?
Got legal clearance to look at source code.
Simplified testcase: public class X<Token, NodeType> { class Table { State<Token> s; Table() { this.s = new State<Token>(); } class State<T> { } } } This should compile with no error. Problem comes from ParameterizedSingleTypeReference which fails to convert X<Token,NodeType>.Table into a parameterized type. Added GenericTypeTest#test1293-1294
Patch combined with https://bugs.eclipse.org/bugs/attachment.cgi?id=90846 Also added GenericTypeTest#test1296-1298 Released for 3.4M6. Fixed
Released fix in 3.3.x maintenance branch (post 3.3.2)
Verified for 3.4M6 using I20080324-1300.