www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23836] New: Two errors printed for typeof(super) in

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 puremagic.com
          Reporter: elpenguino+D 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`

--
Apr 12 2023