Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » interface default method: how to implement
interface default method: how to implement [message #1787425] Fri, 25 May 2018 08:28 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi, I try to implement a default method in an interface as follows:

interface Foo
{
   def asString(String value)
   {
      if (value === null) "" else value
   }
}


The editor complains, that "Abstract methods do not specify a body". I followed the example in https://www.eclipse.org/xtend/documentation/202_xtend_classes_members.html#interfaces, but without success.
Thanks for any help!
Re: interface default method: how to implement [message #1787427 is a reply to message #1787425] Fri, 25 May 2018 08:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
which xtext / xtend version do you use? which java compiler level did you set on the project and in the xtend settings

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: interface default method: how to implement [message #1787432 is a reply to message #1787427] Fri, 25 May 2018 09:19 Go to previous messageGo to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
xtend version: 2.12.0.v20170518-0757, project settings: Java-SE9
Re: interface default method: how to implement [message #1787433 is a reply to message #1787432] Fri, 25 May 2018 09:36 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i read "java 5" (in the compiler settings

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:interface default method: how to implement
Next Topic:how to write (existing) java 8 lambda in xtend
Goto Forum:
  


Current Time: Fri Apr 19 22:30:47 GMT 2024

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

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

Back to the top