[Issue 23138] New: Overrides of member functions of an inherited class ignores attribute "downcast"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 25 08:33:28 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23138

          Issue ID: 23138
           Summary: Overrides of member functions of an inherited class
                    ignores attribute "downcast"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: contact at lsferreira.net

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 {})();
    }
}
```

--


More information about the Digitalmars-d-bugs mailing list