struct A { int a; alias a this; } void main() { A t; switch(t) { default: } } With dmd 2.059 this results in: test.d(7): Error: 't' is not of integral type, it is a A I believe the alias this should allow this to work.
I was bitten and surprised by this bug... Any plans to fix this?
https://github.com/D-Programming-Language/dmd/pull/5146
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6b848c352f0865986fc6a0ed9e09effc4f014458 fix Issue 7979 - Alias this does not work with switch https://github.com/D-Programming-Language/dmd/commit/ae47818a061e88325b629af185b06024424f70ce Merge pull request #5146 from 9rnsr/fix7979 Issue 7979 - Alias this does not work with switch
*** Issue 13820 has been marked as a duplicate of this issue. ***