Bug 23138 – Overrides of member functions of an inherited class ignores attribute "downcast"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-05-25T08:33:28Z
Last change time
2022-05-26T12:23:13Z
Keywords
pull
Assigned to
No Owner
Creator
Luís Ferreira

Comments

Comment #0 by contact — 2022-05-25T08:33:28Z
The following code compiles and shouldn't because it is illegal to lower the @safe to @system on an override. The compiler doesn't lower, just ignores it, but this makes the user confuse. ```d class C1 { void foo() pure nothrow @safe {} } class C2 : C1 { override void foo() @system { // (() @system {})(); } } ```
Comment #1 by dlang-bot — 2022-05-25T09:45:07Z
@ljmf00 created dlang/dmd pull request #14166 "fix(dsymbolsem): override methods should have semantic logic on attributes" fixing this issue: - fix(dsymbolsem): override methods should have semantic logic on attributes Fix issue 23138. Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/14166
Comment #2 by dlang-bot — 2022-05-26T12:23:13Z
dlang/dmd pull request #14166 "fix(dsymbolsem): override methods should have semantic logic on attributes" was merged into master: - e403ec44e4773686270f26fe03134cf50454bfdc by Luís Ferreira: fix(dsymbolsem): override methods should have semantic logic on attributes Fix issue 23138. Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/14166