May 27, 2008 [Issue 2132] New: CTFE: can't evaluate ~= at compile time, D2 only. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2132 Summary: CTFE: can't evaluate ~= at compile time, D2 only. Product: D Version: 2.014 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: clugdbug@yahoo.com.au This triggers the behaviour shown in bugzilla #1947; but that's incidental. Here, it's the error message which is the problem. It works OK on D1, and also works on D2 if you use ~ instead of ~=. The problem could be related to #1768, but the workaround there (explicitly initialising the variable) doesn't work here. ------ bug.d(10): Error: cannot evaluate func(";") at compile time bug.d(10): Error: argument to mixin must be a string, not (func(";")) Statement::blockExit(009989DC) mixin(func(";")); Assertion failure: '0' on line 123 in file 'statement.c' abnormal program termination ----------- --- char [] func(invariant char [] s) { char [] u = "".dup; u ~= s; // ICE u = u ~ s; // OK return u; } void main() { mixin(func(";")); } -- |
June 22, 2008 [Issue 2132] CTFE: can't evaluate ~= at compile time, D2 only. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2132 bugzilla@digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from bugzilla@digitalmars.com 2008-06-22 18:57 ------- Fixed dmd 1.031 and 2.015 -- |
Copyright © 1999-2021 by the D Language Foundation