On Friday, 19 October 2018 at 06:53:32 UTC, dangbinghoo wrote:
why the code bellow compiles?
D compilers are allowed to make that an error, but it might not.
With the current implementation,
dmd that.d
will compile, but
dmd -O that.d
will fail with an error. Yes, turning on optimizations
On Monday, 22 October 2018 at 01:39:48 UTC, dangbinghoo wrote:
On Friday, 19 October 2018 at 09:08:32 UTC, Vijay Nayar wrote:
Technically the code you have is syntactically correct. You
are permitted to create a class variable without assigning it
to a class object. (Assigning it to a class
On Friday, 19 October 2018 at 09:08:32 UTC, Vijay Nayar wrote:
Technically the code you have is syntactically correct. You
are permitted to create a class variable without assigning it
to a class object. (Assigning it to a class object would look
like "A a = new A();")
Which section of The
On Friday, 19 October 2018 at 06:53:32 UTC, dangbinghoo wrote:
hi,
why the code bellow compiles?
---
import std.stdio;
class A {
int m;
}
void main() {
A a;
a.m = 1;
}
---
and running this code get:
`segmentation fault (core dumped) ./test`
I consider this couldn't be compiled
hi,
why the code bellow compiles?
---
import std.stdio;
class A {
int m;
}
void main() {
A a;
a.m = 1;
}
---
and running this code get:
`segmentation fault (core dumped) ./test`
I consider this couldn't be compiled according to book Programming Language>.
The latest dmd