Re: Very strange compilation error

2014-10-16 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 15 October 2014 at 21:28:05 UTC, Nils Boßung wrote: On Wednesday 15 October 2014 22:13, John Colvin wrote: On Wednesday, 15 October 2014 at 19:29:27 UTC, Jack Applegame wrote: I don't understand why this code doesn't compile: http://dpaste.dzfl.pl/dfd8df7f80ad that should be i

Re: Very strange compilation error

2014-10-15 Thread Nils Boßung via Digitalmars-d-learn
On Wednesday 15 October 2014 22:13, John Colvin wrote: > On Wednesday, 15 October 2014 at 19:29:27 UTC, Jack Applegame > wrote: >> I don't understand why this code doesn't compile: >> >> http://dpaste.dzfl.pl/dfd8df7f80ad > > that should be immutable(ubyte)[] not immutable ubyte[] which is > equi

Re: Very strange compilation error

2014-10-15 Thread Nils Boßung via Digitalmars-d-learn
On Wednesday 15 October 2014 21:29, Jack Applegame wrote: > I don't understand why this code doesn't compile: > > http://dpaste.dzfl.pl/dfd8df7f80ad Immutability issues with unions ring a bell for me. This may be related to issue 12885 [1] which is the result of dmd pull #2665 [2] which even m

Re: Very strange compilation error

2014-10-15 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 15 October 2014 at 19:29:27 UTC, Jack Applegame wrote: I don't understand why this code doesn't compile: http://dpaste.dzfl.pl/dfd8df7f80ad that should be immutable(ubyte)[] not immutable ubyte[] which is equivalent to immutable(ubyte[]). You can't overwrite immutable data, hen

Very strange compilation error

2014-10-15 Thread Jack Applegame via Digitalmars-d-learn
I don't understand why this code doesn't compile: http://dpaste.dzfl.pl/dfd8df7f80ad

Re: strange compilation error

2014-03-09 Thread Kenji Hara
On Sunday, 9 March 2014 at 11:21:19 UTC, Jack Applegame wrote: This fails to compile http://dpaste.dzfl.pl/e9a90e808af4 It's a compiler bug. https://d.puremagic.com/issues/show_bug.cgi?id=12334 https://github.com/D-Programming-Language/dmd/pull/3371 Kenji Hara

Re: strange compilation error

2014-03-09 Thread bearophile
Marc Schütz: The error message is confusing, though. main is not a nested function, rather it's a function _containing_ a nested class... If you don't like the error message then I suggest to open in Bugzilla a diagnostic bug report (if you want with "minor" importance). Bye, bearophile

Re: strange compilation error

2014-03-09 Thread Marc Schütz
On Sunday, 9 March 2014 at 12:21:18 UTC, bearophile wrote: Jack Applegame: This fails to compile http://dpaste.dzfl.pl/e9a90e808af4 There are various ways to avoid this problem, using static classes/structs is one of the simplest: void main() { static class B { int a; t

Re: strange compilation error

2014-03-09 Thread Jack Applegame
On Sunday, 9 March 2014 at 12:21:18 UTC, bearophile wrote: Jack Applegame: This fails to compile http://dpaste.dzfl.pl/e9a90e808af4 There are various ways to avoid this problem, using static classes/structs is one of the simplest: void main() { static class B { int a; t

Re: strange compilation error

2014-03-09 Thread bearophile
Jack Applegame: This fails to compile http://dpaste.dzfl.pl/e9a90e808af4 There are various ways to avoid this problem, using static classes/structs is one of the simplest: void main() { static class B { int a; this(int aa) { a = aa; } } auto foo = { retur

strange compilation error

2014-03-09 Thread Jack Applegame
This fails to compile http://dpaste.dzfl.pl/e9a90e808af4