Bug 11333 – ICE: Cannot subtype 0-tuple with "alias this"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-23T11:57:00Z
Last change time
2014-05-13T23:03:37Z
Keywords
ice, pull
Assigned to
nobody
Creator
samukha

Comments

Comment #0 by samukha — 2013-10-23T11:57:57Z
template id(a...) { alias id = a; } struct Unit { enum value = Unit.init.tupleof; alias value this; } void foo() { } void main() { id!() unit; unit = unit; // ok foo(unit); // ok unit = Unit.value; // ok foo(Unit.value); // ok Unit unit2; unit = unit2; // Segmentation fault (core dumped) foo(unit2); // Error: function test.foo () is not callable using argument types (Unit) }
Comment #1 by k.hara.pg — 2014-05-13T06:22:12Z
(In reply to Max Samukha from comment #0) > Unit unit2; > unit = unit2; // Segmentation fault (core dumped) https://github.com/D-Programming-Language/dmd/pull/3546 > foo(unit2); // Error: function test.foo () is not callable using > argument types (Unit) This is currently not allowed. See issue 2779.
Comment #2 by github-bugzilla — 2014-05-13T23:03:37Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d629aa1df464bd1882954487bfaeb97981da8a35 fix Issue 11333 - ICE: Cannot subtype 0-tuple with "alias this" https://github.com/D-Programming-Language/dmd/commit/9e8231346460a547d4cec319e30cc980193ccd94 Merge pull request #3546 from 9rnsr/fix11333 Issue 11333 - ICE: Cannot subtype 0-tuple with "alias this"