| Summary: | [Xtend 2.1] cannot access object methods for interface types | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Edwin Park <esp1> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow, sven.efftinge |
| Version: | 2.1.0 | Flags: | sven.efftinge:
juno+
|
| Target Milestone: | M4 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Edwin Park
This works for me: val List<String> l = null l.^class Please provide more information and reopen the ticket if the problem persists. Hi Sebastian,
I did some more investigation, and found out that the problem exists only in some rather particular circumstances. If I just have a simple Xtend file with a single method that has any of the code snippets above in it, it works fine. BUT if I introduce another method that appends values to a collection, the error appears. Try the following Xtend class - you should see an error in methodTwo on the ^class accessor:
package foo
import java.util.List
import java.util.HashSet
class Foo {
def methodOne() {
val strings = new HashSet<String>()
strings += "a"
}
def methodTwo() {
val List<String> l = null
l.^class
}
}
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |