Bug 1146 – mixin + assert() crashes compiler

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-04-14T15:56:00Z
Last change time
2014-02-16T15:24:22Z
Assigned to
bugzilla
Creator
dheld
Depends on
1159

Comments

Comment #0 by dheld — 2007-04-14T15:56:38Z
The code below results in the compiler attempting to dereference a null pointer. I don't know if the code should be legal or not, but I'm pretty sure the compiler shouldn't crash either way. emplate MetaString(String) { alias String Value; } void main() { alias MetaString!("2 == 1") S; assert(mixin(S.Value)); }
Comment #1 by thomas-dloop — 2007-04-23T12:54:29Z
"template MetaString(String)" expects String to be a type, "2 == 1" isn't a type thus the code is illegal. Added to DStress as http://dstress.kuehne.cn/nocompile/m/mixin_33_A.d http://dstress.kuehne.cn/nocompile/m/mixin_33_B.d http://dstress.kuehne.cn/nocompile/m/mixin_33_C.d
Comment #2 by bugzilla — 2007-04-27T14:57:30Z
Fixed DMD 1.014