March 23, 2011 Re: TDPL 6.4.3 Overriding Is Only Voluntary | ||||
---|---|---|---|---|
| ||||
> "The override keyword in the signature of Friend.bgColor is required," > (193) > > This code compiles: > > class Contact{ string bgColor(){ return ""; } } > class Friend : Contact{ > string bgColor(){ return "LightGreen"; } > } > > So how is 'override' required? Can I get an example of where 'override' makes a difference? dmd is behind TDPL on several counts. This is one of them ( http://d.puremagic.com/issues/show_bug.cgi?id=3836 ). Eventually, override _will_ be required. Right now, it's only required when compiling with -w. - Jonathan M Davis |
Copyright © 1999-2021 by the D Language Foundation