Bug 10778 – Can't define a std.typecons.Typedef of a significant 2D matrix

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-08-08T07:42:07Z
Last change time
2020-03-21T03:56:35Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-08-08T07:42:07Z
import std.typecons: Typedef; alias Matrix = double[260][260]; alias Foo = Typedef!Matrix; void main() {} dmd 2.064alpha gives: test.d(3): Error: template instance std.typecons.Typedef!(double[360u][260u]) recursive expansion My main use case for Typedef is with arrays, to tell them apart, to avoid bugs. This used to work correctly: alias Matrix = double[260][260]; typedef Matrix Foo; void main() { Foo m; }
Comment #1 by b2.temp — 2019-03-30T11:46:44Z
This works now. What is strange is that compiling this is super slow, 2 seconds here.