https://issues.dlang.org/show_bug.cgi?id=5200
RazvanN changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=5200
Brad Roberts bra...@puremagic.com changed:
What|Removed |Added
Platform|x86_64 |x86
--- Comment #2
Jonathan M Davis wrote:
On Wednesday 10 November 2010 13:01:55 Jens Mueller wrote:
So, while I don't necessarily see anything wrong with calling fun() in
this situation being legal, I don't see the point.
My main point is that I'd like to know what is implemented as in
mentioned TDPL
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
Hi,
according to TDPL p. 294 the following call to fun should not be
allowed. But it compiles and I see not why that shouldn't be allowed. I think
it's a bug in TDPL but I'm unsure.
class A {
int a;
int[] b;
this() immutable {
a = 5;
b = [ 1, 2, 3 ];
fun();
On Wednesday, November 10, 2010 06:14:07 Jens Mueller wrote:
Hi,
according to TDPL p. 294 the following call to fun should not be
allowed. But it compiles and I see not why that shouldn't be allowed. I
think it's a bug in TDPL but I'm unsure.
class A {
int a;
int[] b;
Jonathan M Davis wrote:
On Wednesday, November 10, 2010 06:14:07 Jens Mueller wrote:
Hi,
according to TDPL p. 294 the following call to fun should not be
allowed. But it compiles and I see not why that shouldn't be allowed. I
think it's a bug in TDPL but I'm unsure.
class A {
On Wednesday 10 November 2010 13:01:55 Jens Mueller wrote:
You mean alter A's state. It could change something outside of A, couldn't
it?
I suppose that it could. I forgot about that. It's certainly not something that
I'd ever think of doing. It would be bizarre to alter global state from a