hello.d
-------
void main() {
string a = "Hello " ~ unknownVariable;
}
$ dmd hello.d
hello.d(2): Error: undefined identifier unknownVariable
hello.d(2): Error: incompatible types for (("Hello ") ~ (unknownVariable)): 'invariant(char[6u])' and 'int'
Segmentation fault
Comment #1 by spam — 2007-11-30T12:39:37Z
i stumbled upon this one also quite often. its more because of the concat operator i think, cause a simple expression
a = unknown;
doesnt crash.
Comment #2 by gide — 2007-12-04T05:58:27Z
Agreed, I think concat operator looks like the issue, the following code also seg faults the compiler.
void main() {
string a = "Hello " ~ 10;
}
$ dmd hello.d
hello.d(4): Error: incompatible types for (("Hello ") ~ (10)): 'invariant(char[6u])' and 'int'
Segmentation fault
Comment #3 by bugzilla — 2008-01-02T19:49:29Z
Fixed dmd 2.009
Comment #4 by gide — 2008-09-10T04:48:50Z
Broken in dmd 2.012 onwards.
Comment #5 by clugdbug — 2009-04-14T04:57:17Z
*** Bug 1916 has been marked as a duplicate of this bug. ***