D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7158 - [CTFE] ICE(interpret.c) calling a class member using a dotvar expression
Summary: [CTFE] ICE(interpret.c) calling a class member using a dotvar expression
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-23 00:49 UTC by Nils
Modified: 2015-06-09 05:15 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 Nils 2011-12-23 00:49:33 UTC
---
class C {
	bool b() {return true;}
}
struct S {
	C c;
}

bool test() {
	S s = S(new C);
	return s.c.b;
}
static assert(test());
---
Gives "dmd: interpret.c:4643: virtual Expression* CallExp::interpret(InterState*, CtfeGoal): Assertion `thisval && thisval->op == ((TOK)(TOKMAX+1))' failed."

These variations don't give errors:
---
bool test() {
	return S(new C).c.b;
}
bool test() {
	S s = S(new C);
	C c = s.c;
	return c.b;
}
---