← Back to index
|
Original Bugzilla link
Bug 19592 – Rule for IdentifierList is wrong
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-01-16T14:52:47Z
Last change time
2019-01-22T11:18:46Z
Keywords
pull
Assigned to
No Owner
Creator
Basile-z
Comments
Comment #0
by b2.temp — 2019-01-16T14:52:47Z
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
Comment #1
by b2.temp — 2019-01-16T15:08:35Z
The way it's done in DMD parser seems to say that Identifier "[" AssignExpression "]" "." IdentifierList should rather be Identifier "[" AssignExpression "]" ( "." IdentifierList )opt (link 3 of OP)
Comment #2
by b2.temp — 2019-01-16T15:36:44Z
The AssignExp must be optional (for the dynamic arrays case) pull :
https://github.com/dlang/dlang.org/pull/2556
Comment #3
by github-bugzilla — 2019-01-22T11:18:45Z
Commits pushed to master at
https://github.com/dlang/dlang.org
https://github.com/dlang/dlang.org/commit/870cf7441e9a3e302c8fbcdca8c408786b486815
fix issue 19592 - Rule for IdentifierList is wrong
https://github.com/dlang/dlang.org/commit/269a972eb1a8db6ac36d30dabb680498c5cb966c
Merge pull request #2556 from Basile-z/issue-19592 fix issue 19592 - Rule for IdentifierList is wrong merged-on-behalf-of: Nicholas Wilson <
[email protected]
>