[xcore] derived feature does not allow class types [message #1736516] |
Thu, 30 June 2016 06:01 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
I have an xcore file with the following classes:
class Information {
String sName
String birthday
String age
}
class Directory {
String name
String address
derived Information xInfo get {
//call the get method here that will return a type Information
}
}
But I am getting this error:
The generic attribute type must not refer to a class
How can I use the derived feature with a class?
[Updated on: Thu, 30 June 2016 08:54] Report message to a moderator
|
|
|
|
|
Re: [xcore] value is not stored when set via xtend [message #1736651 is a reply to message #1736645] |
Thu, 30 June 2016 21:48 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Chris,
Yes, but Information is a class so the feature needs to be a reference
(using the refers keyword).
On 30.06.2016 14:24, chris yo wrote:
> Hi Ed,
>
> I tried to change the contents of the xcore class to a derived feature
> but somehow, it is throwing me an error.
> "The generic attribute type must not refer to a class".
>
> Is it possible to use the derived feature like this:
> derived Information xInfo get {
> return MyVariables::aInfo.findFirst[name.equals(SName)]
> }
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03852 seconds