Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Error This expression is not allowed in this context
Error This expression is not allowed in this context [message #1076937] Thu, 01 August 2013 03:16 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
I used the findFirst to search an array.

The code below gives me an error "This expression is not allowed in this context, since to does not cause any side effects."
xArray.findFirst[name.equals("ME")
   gender != 0
   age.equals(20)   
]


But, it works if I do it this way:
xArray.findFirst[gender != 0]


Whats the proper way of using [x != 0] inside the findFirst if there are more than 1 predicate?
Re: Error This expression is not allowed in this context [message #1076998 is a reply to message #1076937] Thu, 01 August 2013 05:35 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
xArray.findFirst[name.equals("ME") &&
   gender != 0 &&
   age.equals(20)
]

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:EcoreGeneratorFragment: path is unmapped
Next Topic:Context menu on running product not visible
Goto Forum:
  


Current Time: Thu Apr 25 19:50:12 GMT 2024

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

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

Back to the top