Bug 9266 – Cannot define two Tuple objects.

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-03T11:06:00Z
Last change time
2013-02-12T17:07:48Z
Keywords
ice, pull, rejects-valid
Assigned to
nobody
Creator
repeatedly

Comments

Comment #0 by repeatedly — 2013-01-03T11:06:27Z
I hit this issue in msgpack-d with 2.061. Following Tuple definition causes compilation error: Tuple!(ulong) a, b; // Tuple!(ulong) a; works Error message: Assertion failed: (0), function syntaxCopy, file declaration.c, line 183.
Comment #1 by bearophile_hugs — 2013-01-03T16:32:14Z
A little minimized: template Foo(T...) { alias T Foo; } struct Bar(U...) { template spam(U...) { alias Foo!(FieldSpec!(U[0])) spam; } alias spam!U baz; } int main() { Bar!(ulong) a, b; }
Comment #2 by k.hara.pg — 2013-01-03T19:42:28Z
This change introduces the regression. https://github.com/D-Programming-Language/dmd/commit/dd79dd73f0a1553ff4237d759cea92e7222dccbb But, I can't understand why the assertion is invoked...
Comment #3 by lomereiter — 2013-01-04T16:49:30Z
Further reduced test case: template Foo(T...) { T Foo; } struct Bar() { alias Foo!int f; } void main() { Bar!() a, b; }
Comment #4 by k.hara.pg — 2013-01-08T17:30:31Z
(In reply to comment #3) > Further reduced test case: > > template Foo(T...) { > T Foo; > } > > struct Bar() > { > alias Foo!int f; > } > > void main() { > Bar!() a, b; > } Thanks for your work! A pull request to fix the issue: https://github.com/D-Programming-Language/dmd/pull/1447
Comment #5 by repeatedly — 2013-01-08T19:45:50Z
> bearophile, Artem Thanks for minimizing the test case! > kenji LGTM!
Comment #6 by k.hara.pg — 2013-01-09T16:11:52Z
Comment #7 by k.hara.pg — 2013-02-12T17:07:48Z
*** Issue 9499 has been marked as a duplicate of this issue. ***