[Issue 19464] typeof immutable fields order dependent

2018-12-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19464 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b5f54880fea5a9a5bd1cbdb6767a2e34ef2b8761 Fix Issue 19464 - typeof immutable fields order dependent

[Issue 19464] typeof immutable fields order dependent

2018-12-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19464 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 19464] typeof immutable fields order dependent

2018-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19464 RazvanN changed: What|Removed |Added CC||razvan.nitu1...@gmail.com --- Comment #2 from

[Issue 19464] typeof immutable fields order dependent

2018-12-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19464 Simen Kjaeraas changed: What|Removed |Added CC||simen.kja...@gmail.com --- Comment #1 from

[Issue 19464] New: typeof immutable fields order dependent

2018-12-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19464 Issue ID: 19464 Summary: typeof immutable fields order dependent Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority

[Issue 19022] CTorFlow: Show the line of the duplicated initialization for const/immutable fields

2018-06-27 Thread d-bugmail--- via Digitalmars-d-bugs
initialization for const/immutable fields https://github.com/dlang/dmd/commit/033d324957ff5bee8e25c7335eab2c562d17e2b1 Merge pull request #8399 from wilzbach/fix-19022 Fix Issue 19022 - CTorFlow: Show the line of the duplicated initialization for const/immutable fields merged-on-behalf-of: Jacob

[Issue 19022] CTorFlow: Show the line of the duplicated initialization for const/immutable fields

2018-06-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19022 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 19022] CTorFlow: Show the line of the duplicated initialization for const/immutable fields

2018-06-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19022 --- Comment #1 from Seb --- A naive attempt: https://github.com/dlang/dmd/pull/8399 --

[Issue 19022] New: CTorFlow: Show the line of the duplicated initialization for const/immutable fields

2018-06-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19022 Issue ID: 19022 Summary: CTorFlow: Show the line of the duplicated initialization for const/immutable fields Product: D Version: D2 Hardware: All OS: All

Why are immutable fields with initializers deprecated?

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
A recent discussion https://github.com/D-Programming-Language/dmd/pull/3452 brought up a matter I'd forgotten - struct fields that are immutable and have initializer are deprecated. Why? Andrei

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 13:09:01 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: A recent discussion https://github.com/D-Programming-Language/dmd/pull/3452 brought up a matter I'd forgotten - struct fields that are immutable and have initializer are deprecated. Why? I

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Kenji Hara via Digitalmars-d
In future release, non-static const or immutable field will be made an instance field. struct S { immutable int x = 1; } static assert(S.sizeof == int.sizeof); // will succeed in the future So current implicit static behavior is now deprecated. Related:

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Nick Treleaven via Digitalmars-d
On Tuesday, 29 April 2014 at 17:11:50 UTC, Steven Schveighoffer wrote: On Tue, 29 Apr 2014 13:09:01 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: A recent discussion https://github.com/D-Programming-Language/dmd/pull/3452 brought up a matter I'd forgotten - struct fields

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/14, 10:18 AM, Kenji Hara via Digitalmars-d wrote: In future release, non-static const or immutable field will be made an instance field. struct S { immutable int x = 1; } static assert(S.sizeof == int.sizeof); // will succeed in the future So current implicit static behavior is

[Issue 10753] std.array.array of a range of structs with immutable fields too

2013-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10753 monarchdo...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|

[Issue 10753] std.array.array of a range of structs with immutable fields too

2013-08-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10753 monarchdo...@gmail.com changed: What|Removed |Added CC||monarchdo...@gmail.com ---

[Issue 10753] New: std.array.array of a range of structs with immutable fields too

2013-08-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10753 Summary: std.array.array of a range of structs with immutable fields too Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords

Instantiating a Tuple with immutable fields.

2011-06-16 Thread Jose Armando Garcia
Hi, I am trying to instantiate a Tuple that contains an immutable field. Is there a way to do this with the current implementation? The compiler gives me this error: std/typecons.d(383): Error: can only initialize const member _field_field_0 inside constructor tuple_test.d(5): Error: template

Re: Instantiating a Tuple with immutable fields.

2011-06-16 Thread bearophile
Jose Armando Garcia: I am trying to instantiate a Tuple that contains an immutable field. Is there a way to do this with the current implementation? I think this is not yet possible. I am not sure, but maybe even small changes to conts are needed to fix this problem. Bye, bearophile

Re: Immutable fields

2010-11-25 Thread Bruno Medeiros
On 03/11/2010 10:42, Lars T. Kyllingstad wrote: On Tue, 02 Nov 2010 20:54:35 -0400, bearophile wrote: Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): This is bug 3449:

Re: Immutable fields

2010-11-08 Thread Jacob Carlborg
On 2010-11-08 02:13, Andrei Alexandrescu wrote: On 11/7/10 2:40 PM, Stewart Gordon wrote: On 03/11/2010 03:06, Daniel Murphy wrote: bearophilebearophileh...@lycos.com wrote in message news:iaqbsb$1d3...@digitalmars.com... Is it correct for immutable struct fields to act like enum or static

Re: Immutable fields

2010-11-07 Thread Stewart Gordon
On 03/11/2010 03:06, Daniel Murphy wrote: bearophilebearophileh...@lycos.com wrote in message news:iaqbsb$1d3...@digitalmars.com... Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): immutable struct fields can be

Re: Immutable fields

2010-11-07 Thread Andrei Alexandrescu
On 11/7/10 2:40 PM, Stewart Gordon wrote: On 03/11/2010 03:06, Daniel Murphy wrote: bearophilebearophileh...@lycos.com wrote in message news:iaqbsb$1d3...@digitalmars.com... Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong

Re: Immutable fields

2010-11-03 Thread Lars T. Kyllingstad
On Tue, 02 Nov 2010 20:54:35 -0400, bearophile wrote: Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): This is bug 3449: http://d.puremagic.com/issues/show_bug.cgi?id=3449 -Lars

Re: Immutable fields

2010-11-03 Thread bearophile
Lars T. Kyllingstad: This is bug 3449: http://d.puremagic.com/issues/show_bug.cgi?id=3449 Thank you to you and the others that have answered in this thread. That's an important bug, it changes how much I can use immutables. Bye, bearophile

Immutable fields

2010-11-02 Thread bearophile
Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): struct Foo { immutable int x = 1; } static assert(Foo.sizeof == 4); void main() {} More info in the D.learn thread:

Re: Immutable fields

2010-11-02 Thread Daniel Murphy
bearophile bearophileh...@lycos.com wrote in message news:iaqbsb$1d3...@digitalmars.com... Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): immutable struct fields can be changed inside the constructor, so they must

Re: Immutable fields

2010-11-02 Thread Jonathan M Davis
On Tuesday 02 November 2010 17:54:35 bearophile wrote: Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): struct Foo { immutable int x = 1; } static assert(Foo.sizeof == 4); void main() {} More info in the

Re: Immutable fields

2010-11-02 Thread bearophile
Jonathan M Davis: Why would it really matter though? I guess you have not followed my link with more explanations, right? :-) Bye, bearophile

Re: Immutable fields

2010-11-02 Thread Gareth Charnock
On 03/11/10 00:54, bearophile wrote: Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): struct Foo { immutable int x = 1; } static assert(Foo.sizeof == 4); void main() {} More info in the D.learn thread:

Re: Immutable fields

2010-11-02 Thread bearophile
Daniel Murphy: immutable struct fields can be changed inside the constructor, so they must be non-static. So do you think my code shows a compiler bug? Bye, bearophile

Re: Immutable fields

2010-11-02 Thread Gareth Charnock
On 03/11/10 02:20, Gareth Charnock wrote: On 03/11/10 00:54, bearophile wrote: Is it correct for immutable struct fields to act like enum or static const fields? (I don't think so, but I am wrong often): struct Foo { immutable int x = 1; } static assert(Foo.sizeof == 4); void main() {} More

Re: Immutable fields

2010-11-02 Thread Jonathan M Davis
On Tuesday 02 November 2010 19:24:29 bearophile wrote: Jonathan M Davis: Why would it really matter though? I guess you have not followed my link with more explanations, right? :-) Bye, bearophile I don't really get what you're doing there or what the problem is. You cast one struct to

Re: Immutable fields

2010-11-02 Thread Leandro Lucarella
Jonathan M Davis, el 2 de noviembre a las 20:02 me escribiste: On Tuesday 02 November 2010 19:24:29 bearophile wrote: Jonathan M Davis: Why would it really matter though? I guess you have not followed my link with more explanations, right? :-) Bye, bearophile I don't really

Re: Immutable fields

2010-11-02 Thread Leandro Lucarella
Daniel Murphy, el 3 de noviembre a las 13:52 me escribiste: bearophile bearophileh...@lycos.com wrote in message news:iaqgvl$1qb...@digitalmars.com... So do you think my code shows a compiler bug? I'd like immutable to be implicitly static in some cases eg. void foo() { immutable

Re: Immutable fields

2010-11-02 Thread Jonathan M Davis
On Tuesday 02 November 2010 21:00:00 Leandro Lucarella wrote: Jonathan M Davis, el 2 de noviembre a las 20:02 me escribiste: On Tuesday 02 November 2010 19:24:29 bearophile wrote: Jonathan M Davis: Why would it really matter though? I guess you have not followed my link with more