Bug 21458 – missed opportunity to propagate `final` to aliased symbol
Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-12-07T11:11:30Z
Last change time
2023-10-03T16:44:08Z
Keywords
accepts-invalid, diagnostic
Assigned to
No Owner
Creator
Basile-z
Comments
Comment #0 by b2.temp — 2020-12-07T11:11:30Z
a case of noop attribute:
---
class Y {}
class A(T) {}
final alias B = A!Y; // final class B : A!T {} ???
class C : B {} // could be rejected, B being "final"
void main()
{
C b;
}
---
Comment #1 by b2.temp — 2020-12-07T11:14:50Z
sorry guys, first comment should be
// final class B : A!Y {} ???
suposing the alias create this
Comment #2 by b2.temp — 2020-12-07T11:53:26Z
note that
---
class Y {}
class A(T) {}
alias B = final A!Y;
class C : B {}
---
gives
> /tmp/temp_7F8354048F90.d:7:20: Deprecation: storage class `final` has no effect in type aliases
which is a bit better