[Issue 23836] New: Two errors printed for typeof(super) in non-static member context

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 12 16:42:21 UTC 2023


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

          Issue ID: 23836
           Summary: Two errors printed for typeof(super) in non-static
                    member context
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

```
struct Foo {
  static bar() {
    alias X = typeof(super);
  }
}
```
Currently this prints two errors instead of just one:
`Error: 'super' is not in a class scope`
`Error: 'super' is only allowed in non-static class member functions`

--


More information about the Digitalmars-d-bugs mailing list