www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19592] New: Rule for SuperClass is wrong

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

          Issue ID: 19592
           Summary: Rule for SuperClass is wrong
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

For this code

    import std.meta;
    class Base{}
    alias Bases = AliasSeq!(Base);
    class Derived : Bases[0] {}

- `Bases[0]` is a SuperClass [1] 
- SuperClass wraps a BasicType [2]  
- BasicType doesn't contain a rule allowing to index something in the way the
code does.

The only time it's allowed is when it uses a IdentifierList [3] but then it's
always followed by another, non optional IdentifierList:

    Identifier [ AssignExpression ]. IdentifierList

`Bases[0]` can only be described with a Type, since the indexing followed by
nothing is a BasicType2X.

[1]: https://dlang.org/spec/class.html#SuperClass
[2]: https://dlang.org/spec/declaration.html#BasicType
[3]: https://dlang.org/spec/declaration.html#IdentifierList
[4]: https://dlang.org/spec/declaration.html#BasicType2X

--
Jan 16