[Issue 16410] attribute inference for final methods of templated classes
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 10 13:15:10 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=16410
RazvanN <razvan.nitu1305 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |razvan.nitu1305 at gmail.com
Resolution|--- |INVALID
--- Comment #12 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to Lodovico Giaretta from comment #10)
> (In reply to Lodovico Giaretta from comment #9)
> > Then a new question arises: why cannot attribute inference happen for
> > *final* methods of templated classes?
>
> Small precisation: I mean *final override* methods. For final (non-virtual)
> methods it already happens.
The compiler cannot infer the attributes for final override methods because you
already may have some constraints from the overriding function. For example, if
the overriden function is @safe, the overriding function must also be @safe.
Technically, the overriden function dictates the interface. I think it might be
surprising to the attributes for overrides, even if they are final.
I think we can close this issue as INVALID.
--
More information about the Digitalmars-d-bugs
mailing list