2132 – CTFE: can't evaluate ~= at compile time, D2 only.

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2132 - CTFE: can't evaluate ~= at compile time, D2 only.
Summary: CTFE: can't evaluate ~= at compile time, D2 only.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2008年05月27日 07:32 UTC by Don
Modified: 2015年06月09日 01:21 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2008年05月27日 07:32:54 UTC
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(";"));
}
Comment 1 Walter Bright 2008年06月22日 18:57:31 UTC
Fixed dmd 1.031 and 2.015


AltStyle によって変換されたページ (->オリジナル) /