digitalmars.D.learn - Is live attribute working yet?
- elfstone (24/24) Apr 24 2022 Dub(DMD 2.099.1) builds and runs the following code without a
- Tejas (3/27) Apr 24 2022 It's development is stalled 😞
- elfstone (4/36) Apr 24 2022 Thanks a lot. I guess I should have taken the "Experimental,
- Paolo Invernizzi (4/28) Apr 24 2022 You need to use the flag `-preview=dip1021`
- elfstone (3/8) Apr 24 2022 Weird, it's still not working here. I have tried the flag with
- Paolo Invernizzi (10/21) Apr 24 2022 You are right with 2.099.1, it seems to be included in the
Dub(DMD 2.099.1) builds and runs the following code without a warning. import std.stdio; import core.stdc.stdlib; live void test() { int* p = cast(int*) malloc(32); p = cast(int*) malloc(32); free(p); } void main() { test(); writeln("???"); } Isn't it supposed to trigger an error according to the doc (https://dlang.org/spec/ob.html)? live void test() { auto p = allocate(); p = allocate(); // error: p was not disposed of release(p); }
Apr 24 2022
On Sunday, 24 April 2022 at 09:31:40 UTC, elfstone wrote:Dub(DMD 2.099.1) builds and runs the following code without a warning. import std.stdio; import core.stdc.stdlib; live void test() { int* p = cast(int*) malloc(32); p = cast(int*) malloc(32); free(p); } void main() { test(); writeln("???"); } Isn't it supposed to trigger an error according to the doc (https://dlang.org/spec/ob.html)? live void test() { auto p = allocate(); p = allocate(); // error: p was not disposed of release(p); }It's development is stalled 😞 https://forum.dlang.org/post/dvbqnlpqainnbtmbuyhl forum.dlang.org
Apr 24 2022
On Sunday, 24 April 2022 at 11:07:43 UTC, Tejas wrote:On Sunday, 24 April 2022 at 09:31:40 UTC, elfstone wrote:Thanks a lot. I guess I should have taken the "Experimental, Subject to Change" seriously. Still the doc really should be more accurate, like "Just the Idea/To Be Implemented".Dub(DMD 2.099.1) builds and runs the following code without a warning. import std.stdio; import core.stdc.stdlib; live void test() { int* p = cast(int*) malloc(32); p = cast(int*) malloc(32); free(p); } void main() { test(); writeln("???"); } Isn't it supposed to trigger an error according to the doc (https://dlang.org/spec/ob.html)? live void test() { auto p = allocate(); p = allocate(); // error: p was not disposed of release(p); }It's development is stalled 😞 https://forum.dlang.org/post/dvbqnlpqainnbtmbuyhl forum.dlang.org
Apr 24 2022
On Sunday, 24 April 2022 at 09:31:40 UTC, elfstone wrote:Dub(DMD 2.099.1) builds and runs the following code without a warning. import std.stdio; import core.stdc.stdlib; live void test() { int* p = cast(int*) malloc(32); p = cast(int*) malloc(32); free(p); } void main() { test(); writeln("???"); } Isn't it supposed to trigger an error according to the doc (https://dlang.org/spec/ob.html)? live void test() { auto p = allocate(); p = allocate(); // error: p was not disposed of release(p); }You need to use the flag `-preview=dip1021` test.d(8,30): Error: variable `test.test.p` assigning to Owner without disposing of owned value
Apr 24 2022
On Sunday, 24 April 2022 at 11:36:29 UTC, Paolo Invernizzi wrote:On Sunday, 24 April 2022 at 09:31:40 UTC, elfstone wrote:Weird, it's still not working here. I have tried the flag with dub, and dmd.[...]You need to use the flag `-preview=dip1021` test.d(8,30): Error: variable `test.test.p` assigning to Owner without disposing of owned value
Apr 24 2022
On Sunday, 24 April 2022 at 12:21:29 UTC, elfstone wrote:On Sunday, 24 April 2022 at 11:36:29 UTC, Paolo Invernizzi wrote:You are right with 2.099.1, it seems to be included in the 2.100.0-beta.1 ... pinver Moria test % /Users/pinver/dlang/dmd-2.099.1/osx/bin/dmd -preview=dip1021 -c -o- src/test.d pinver Moria test % /Users/pinver/dlang/dmd-2.100.0-beta.1/osx/bin/dmd -preview=dip1021 -c -o- src/test.d src/test.d(8): Error: variable `test.test.p` assigning to Owner without disposing of owned valueOn Sunday, 24 April 2022 at 09:31:40 UTC, elfstone wrote:Weird, it's still not working here. I have tried the flag with dub, and dmd.[...]You need to use the flag `-preview=dip1021` test.d(8,30): Error: variable `test.test.p` assigning to Owner without disposing of owned value
Apr 24 2022