D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6276 - [CTFE] Strange behavior of using ~= operator twice
Summary: [CTFE] Strange behavior of using ~= operator twice
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
: 6435 (view as issue list)
Depends on:
Blocks:
 
Reported: 2011-07-09 01:17 UTC by Hisayuki Mima
Modified: 2011-08-04 05:26 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hisayuki Mima 2011-07-09 01:17:00 UTC
struct Foo{
	int[] i;
}

bool func(){
	Foo foo;
	foo.i ~= 1;
	foo.i ~= 2;//Compile fails on this line.
	return true;
}

When I compiled this source code, compile of dmd v2.054 built from trunk failed.

Error: foo.i ~= 2 cannot be evaluated at compile time

This may shows that operator ~= or array in CTFE has wrong behavior.
Comment 2 Don 2011-08-04 05:26:53 UTC
*** Issue 6435 has been marked as a duplicate of this issue. ***