java compilation fails on this call in list comprehension
I am defining an entity function, which contains a list comprehension. This list comprehension uses another entity function. Consequently the java compilation fails on the list comprehension, because it cannot do a ‘this’ reference in a static context. My code:
entity A {
…
function getConsults(specs : Set) : List{
return [s | s : Consult in getConsults() where s.specialization in specs];
}
function getConsults() …
}As far as I can see, the list comprehension is lifted into a function (in a separate class). As the lifted function is static (and outside the context of the entity), the call to getConsults breaks.
Submitted by Sander Vermolen on 21 January 2011 at 17:15
Log in to post comments