https://issues.dlang.org/show_bug.cgi?id=16410
--- Comment #8 from Lodovico Giaretta <[email protected]> --- (In reply to Steven Schveighoffer from comment #7) > I thought that templated classes would infer attributes. But thinking about > this some more, I wonder if that's correct for virtual base functions? > > I can envision this scenario: > > class Foo(T) > { > string bar() { return "hi"; } > } > > class Bar(T) : Foo!T > { > override string bar() { return super.bar() ~ T.stringof; } > } > > Should Foo(T).bar be @nogc? It would be inferred that if Foo was a struct. > But in this case, it is preventing possibly intended behavior. Sorry, I don't understand why Foo!T.bar being @nogc would prevent possibly intended behaviour. Can you please elaborate on this? --
