Bug 14678 – Bogus cannot create a struct until its size is determined error

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-10T20:47:00Z
Last change time
2015-06-10T23:28:19Z
Assigned to
nobody
Creator
deadalnix

Comments

Comment #0 by deadalnix — 2015-06-10T20:47:48Z
See sample code: enum AstTypeKind { Foo, Bar, } struct AstType { mixin TypeMixin!(AstTypeKind, Payload); this(AstTypeKind) { } import othermodule; } alias ParamAstType = AstType.ParamType; union Payload { ParamAstType* params; } template TypeMixin(K, Payload) { Payload payload; alias ParamType = PackedType!(typeof(this)); struct PackedType(T, U...) { Payload payload; auto getType() { return T(AstTypeKind.Foo); } } } Other module can be an empty file. What is in it doesn't matter, the import being there is the only thing that does matter. Line 32: Error: cannot create a struct until its size is determined Line 25: Error: template instance type.AstType.TypeMixin!(AstTypeKind, Payload).PackedType!(AstType) error instantiating
Comment #1 by dlang-bugzilla — 2015-06-10T23:17:25Z
Good news! This issue is duplicate of Issue 6766, which has been fixed in HEAD. *** This issue has been marked as a duplicate of issue 6766 ***
Comment #2 by deadalnix — 2015-06-10T23:27:01Z
How the hell do you find these duplicates that fast ?
Comment #3 by dlang-bugzilla — 2015-06-10T23:28:19Z
I do a regression test and find which pull request fixes the testcase. TrenD ( http://digger.k3.1azy.net/trend/ ) has all D builds cached, so the regression test runs quickly.