Bug 5287 – (crash mtype.c) on function with default argument
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-11-28T15:38:00Z
Last change time
2010-11-29T01:18:53Z
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2010-11-28T15:38:26Z
This is wrong D2 code:
void foo(Bar* p=null) {}
void main() {
foo();
}
DMD 2.050 crashes on it:
bug.d(1): Error: identifier 'Bar' is not defined
bug.d(1): Error: Bar is used as a type
Assertion failure: 'tn->mod == MODimmutable' on line 880 in file 'mtype.c'
Comment #1 by bearophile_hugs — 2010-11-28T15:39:50Z
A shorter case:
void foo(Bar* p=null) {}
void main() {}
Comment #2 by clugdbug — 2010-11-29T01:18:53Z
*** This issue has been marked as a duplicate of issue 4434 ***