Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xbase: proposals of non-final variables in lambdas
Xbase: proposals of non-final variables in lambdas [message #1403837] Mon, 28 July 2014 08:22
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1759
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

If I remember correctly (at least, I have Junit tests that now fail)
before Xtext 2.6, the default Xbase proposal provider did NOT propose
writable variables within a lambda expression's body

For instance, in Xtend

def m(int i) {
var j = 0
newArrayList().forEach[
println(<--- proposals
]
}

proposals contained "i" but not "j" (since "cannot refer to non-final
variable inside a lambda expression").

This is not the case anymore in Xbase 2.6 (and this is visible also in
Xtend): "j" is proposed as well...

Is that intentional?
I think that before that was implicitly implemented by the deprecated
XbaseScopeProvider, which was used only in the content assist (i.e., not
for type checking and validation).

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:[SOLVED] UnsupportedOperationException on enum
Next Topic:Inherit properties of supertype
Goto Forum:
  


Current Time: Sat Dec 14 19:21:55 GMT 2019

Powered by FUDForum. Page generated in 0.01787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top