http://d.puremagic.com/issues/show_bug.cgi?id=5200
Summary: Call to immutable method during immutable construction
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2010-11-11 01:39:13 PST ---
According to TDPL p. 294 a call to any non-static method in an immutable
constructor is not allowed.
But
class A {
int a;
this() immutable {
a = 5;
fun(); // should not compile
}
void fun() immutable {}
}
compiles with dmd v2.050.
I think the behavior should be clarified. Either in dmd to match TDPL or the
other way round.
I'm going to add a link to a thread on [email protected] for further
information.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------