| Summary: | [Xtend] missing validation for type parameters | ||
|---|---|---|---|
| Product: | [Tools] Xtend | Reporter: | Holger Schill <Holger.Schill> |
| Component: | Core | Assignee: | Jan Koehnlein <jan> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dennis.huebner, jan, moritz.eysholdt, sebastian.zarnekow, sven.efftinge |
| Version: | 2.2.0 | Flags: | sven.efftinge:
kepler+
|
| Target Milestone: | M6 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
| Bug Depends on: | 376037 | ||
| Bug Blocks: | 380055 | ||
The same happens when the TypeReference is a method's return type:
--------- Xtend ---------
import java.util.Map
class Bug {
def Map<Integer> foo() {
}
}
-------------------------
In Xtend, this snipped doesn't cause any error, but in Java it does.
missing error when specifying type parameters for parameterless type:
Example:
--------- Xtend ---------
def List<AbstractEntry<?>> getEntries() {
}
abstract class AbstractEntry {
}
------------------------
There should be an error for <?> since AbstractEntry has no type parameters.
Here, as in the other scenarios, the generated Java code is broken.
Still a valid bug. see also bug# 380055 Pushed to gerrit. Also added a check for wildcards in super types. Requested via bug 522520. -M. Requested via bug 522520. -M. |
The missing validation to report that a type parameter is missing leads to invalid java code for the following example: Java class Test: public abstract class Test<M,T> {} Xtend class Bar : class Bar extends Test<String> {} This is valid for Xtend but produces the following invalid java code: @SuppressWarnings("all") public class Foo extends Test<String> { } The Error is placed on Test with the message: Incorrect number of arguments for type Test<M,T>; it cannot be parameterized with arguments <String>