[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-11-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

--- Comment #8 from Steven Schveighoffer  ---
(In reply to uplink.coder from comment #6)
> In this case the cycle is non-harmful.
> Since no run-time initialized data is used.

Yes, that is what issue 16673 is about -- using statically available data
should not add a dependency.

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-11-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

--- Comment #7 from anonymous4  ---
If it didn't use runtime data, it could be computed at compile time.

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-11-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

uplink.co...@googlemail.com changed:

   What|Removed |Added

 CC||uplink.co...@googlemail.com

--- Comment #6 from uplink.co...@googlemail.com ---
In this case the cycle is non-harmful.
Since no run-time initialized data is used.

We can and should improve the cycle-check.
Preferably in DMD itself, when possible.
I am having a look.

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-11-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com
   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=16673

--- Comment #5 from Steven Schveighoffer  ---
The issue is simply that you have a cycle. Forward referencing has nothing to
do with it.

Unfortunately, this is functioning as designed. Martin has some ideas to make
this possibly work, but those haven't been implemented yet. See
https://issues.dlang.org/show_bug.cgi?id=16673

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-11-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

--- Comment #4 from Ethan Watson  ---
Of course it can be solved by assigning this specific string at compile time.
Because you remove the shared static constructor.

Replace the contents of the constructor with a writeln and delete the gshared
storage. Done. The point is the static constructor and the invalid cyclic
dependency between pointers.

No, seriously. That's two people now to have commented on the most irrelevant
part of the bug. The title of this bug explains exactly what's wrong.

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-11-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

Jacob Carlborg  changed:

   What|Removed |Added

 CC||d...@me.com

--- Comment #3 from Jacob Carlborg  ---
Can you show a more extended example(In reply to Ethan Watson from comment #2)
> It is purely for illustrative/example purposes. The data I'm using cannot be
> immutable.

Can you show a more extended example because the above example can be solved by
directly initializing the variable:

__gshared string someOtherClassName = SomeOtherClass.stringof;

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-09-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

--- Comment #2 from Ethan Watson  ---
It is purely for illustrative/example purposes. The data I'm using cannot be
immutable.

--


[Issue 16491] Forward referencing and static/shared static module constructors break initialisation

2016-09-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16491

--- Comment #1 from Sobirari Muhomori  ---
Can't the name be immutable?

immutable string someOtherClassName = SomeOtherClass.stringof;

--