Summary: | [1.5][compiler] Nested parameter types for class directive | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Martin Kersten <Martin.Kersten> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Martin Kersten
2005-03-11 08:05:30 EST
It seems that class literals with generic types are illegal. See comment in: http://forum.java.sun.com/thread.jspa?forumID=316&threadID=519798 In fact this would collide with the relational expression a < b. Where a and b are names. From the JLS: 15.8.2 Class Literals A class literal is an expression consisting of the name of a class, interface, array, or primitive type, or the pseudo-type void, followed by a ‘.’ and the token class. The type of a class literal, C.Class, where C is the name of a class, interface or array type, is Class<C>. If p is the name of a primitive type, let B be the type of an expression of type p after boxing conversion (§5.1.7). Then the type of p.class is Class<B>. The type of void.class is Class<Void>. This states that only Name are legal as the left hand side of a class literal. Note that javac also rejects such code. So this is not consistent with the rule: Type . class also found in the JLS. See 15.8 Primary Expressions. Closing as INVALID. Thanks for investigating this issue. I will rework my test case to get rid of the unsafe warning. Thanks for your quick action, Cheers, Martin (Kersten) |