| Summary: | [xtend] missing type checks for type casts of primitives | ||
|---|---|---|---|
| Product: | [Tools] Xtend | Reporter: | Knut Wannheden <knut.wannheden> |
| Component: | Core | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow, sven.efftinge |
| Version: | 2.2.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Could be related: Compiling the following:
public class Foo {
def foo() {
switch 123 {
String case null : "foo"
}
}
}
results in an illegal instanceof expression:
@SuppressWarnings("all")
public class Foo {
public String foo() {
String _switchResult = null;
final int __valOfSwitchOver = 123;
boolean matched = false;
if (!matched) {
if (__valOfSwitchOver instanceof String) {
if (ObjectExtensions.operator_equals(__valOfSwitchOver,null)) {
matched=true;
_switchResult = "foo";
}
}
}
return _switchResult;
}
}
related to bug 342007 and bug 342431 *** This bug has been marked as a duplicate of bug 342007 *** |
The following Xtend code: class Other { def bar() { true as String } } compiles to the illegal Java code: @SuppressWarnings("all") public class Other { public String bar() { return ((String) ((Boolean)true)); } } The same thing happend for expressions like "42 as String" etc.