[Issue 5200] New: Call to immutable method during immutable construction
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 11 01:40:19 PST 2010
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: nobody at puremagic.com
ReportedBy: jens.k.mueller at gmx.de
--- Comment #0 from jens.k.mueller at gmx.de 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 digitalmars-d at puremagic.com for further
information.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list