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: 1770
Registered: July 2009
Location: Firenze, Italy
Senior Member

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
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).


Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
Xtext Book:

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

Current Time: Mon Sep 21 20:31:54 GMT 2020

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

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

Back to the top