Skip to main content



      Home
Home » Modeling » TMF (Xtext) » interface default method: how to implement
interface default method: how to implement [message #1787425] Fri, 25 May 2018 04:28 Go to next message
Eclipse UserFriend
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 04:40 Go to previous messageGo to next message
Eclipse UserFriend
which xtext / xtend version do you use? which java compiler level did you set on the project and in the xtend settings
Re: interface default method: how to implement [message #1787432 is a reply to message #1787427] Fri, 25 May 2018 05:19 Go to previous messageGo to next message
Eclipse UserFriend
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 05:36 Go to previous message
Eclipse UserFriend
i read "java 5" (in the compiler settings
Previous Topic:interface default method: how to implement
Next Topic:how to write (existing) java 8 lambda in xtend
Goto Forum:
  


Current Time: Fri Jun 20 07:34:46 EDT 2025

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

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

Back to the top