Re: String switch is odd using betterC

2020-02-26 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 08:32:50 UTC, Abby wrote: On Wednesday, 26 February 2020 at 08:25:00 UTC, Abby wrote: Any idea why? Ok so this is enough to produce the same result, it seems that there is a problem in string switch when there is more the 6 cases. extern(C) void main() {

Re: String switch is odd using betterC

2020-02-26 Thread Petar via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 08:32:50 UTC, Abby wrote: On Wednesday, 26 February 2020 at 08:25:00 UTC, Abby wrote: Any idea why? Ok so this is enough to produce the same result, it seems that there is a problem in string switch when there is more the 6 cases. extern(C) void main() {

Re: String switch is odd using betterC

2020-02-26 Thread Abby via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 08:25:00 UTC, Abby wrote: Any idea why? Ok so this is enough to produce the same result, it seems that there is a problem in string switch when there is more the 6 cases. extern(C) void main() { auto s = "F"; final switch(s) { case "A":

String switch is odd using betterC

2020-02-26 Thread Abby via Digitalmars-d-learn
I have a simple enum of strings like so: enum Alphabet : string { a = "A", b = "B", c = "C", d = "D", e = "E", f = "F", g = "G" } and then simple final switch like so: extern(C) void main() { auto s = Alphabet.f; final switch(s) { case Alphabet.a:

Re: String switch is odd using betterC

2020-02-26 Thread Abby via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 08:25:00 UTC, Abby wrote: /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(2999): Error: TypeInfo cannot be used with -betterC Odd think is that wehen I remove g from my enum it compiles just fine, so it seems that this compilation error occurs only