Skip to main content

Replace on for existing attributes

2 replies [Last post]
are
Offline
Joined: 2008-05-13

Hello, I wonder how I could use the new

attribute foo:Foo = someValue replace on {
doSomething();
};

with an already existing attribute, for example

class MyFrame extends Frame {
attribute title:String on replace {
doSomething();
}
}

doesn't work:

error: Cannot override MyFrame.title default initializer in selected subclass.

Any help is very welcome, I thank you in advance!
Regards
are

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12

You need to use [b]override[/b] keyword:

[code]
class MyFrame extends Frame {

override attribute title = "MyTitle" on replace {
doSomething();
}

}
[/code]

are
Offline
Joined: 2008-05-13

Thank you! Indeed I need, but did not know, it exists!

Best regards
are