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: [email protected]
          Reporter: [email protected]

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

--

Reply via email to