Bug 3085 – Cannot index tuple in declaration

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-06-19T22:09:00Z
Last change time
2017-07-03T18:04:20Z
Keywords
patch, spec
Assigned to
nobody
Creator
rsinfu

Attachments

IDFilenameSummaryContent-TypeSize
400fix_indexinbasictype.patchPatch (DMD 2.030)text/plain5245

Comments

Comment #0 by rsinfu — 2009-06-19T22:09:59Z
Created attachment 400 Patch (DMD 2.030) The current declaration syntax does not handle a qualified type with an intermediate segment which does tuple indexing. For example, the following does not compile: -------------------- import std.typetuple; template Trait(alias v) { alias typeof(v) Type; } alias TypeTuple!(Trait!(42)) List; List[0].Type var; // -> "no identifier for declarator List[0]" -------------------- The compiler cannot parse "List[0].Type" as a type. The attached patch enables the compiler to handle such intermediate tuple indexing with a slight change to the BasicType2 syntax: -------------------- BasicType2: * [ ] [ Expression ] [ Expression .. Expression ] [ Type ] delegate Parameters FunctionAttributes_opt function Parameters FunctionAttributes_opt . IdentifierList // !! Add this --------------------
Comment #1 by manuelk89 — 2010-10-11T12:36:18Z
*** Issue 1503 has been marked as a duplicate of this issue. ***
Comment #2 by manuelk89 — 2010-10-11T12:42:21Z
*** Issue 2446 has been marked as a duplicate of this issue. ***
Comment #3 by dlang-bugzilla — 2017-07-03T18:04:20Z
Fixed by https://github.com/dlang/dmd/pull/4516. *** This issue has been marked as a duplicate of issue 1215 ***