Bug 7979 – Alias this does not work with switch

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-24T09:54:00Z
Last change time
2016-09-18T19:24:38Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
robert

Comments

Comment #0 by robert — 2012-04-24T09:54:09Z
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.
Comment #1 by luis — 2015-09-30T02:39:41Z
I was bitten and surprised by this bug... Any plans to fix this?
Comment #2 by k.hara.pg — 2015-09-30T05:59:51Z
Comment #3 by github-bugzilla — 2015-09-30T22:05:33Z
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
Comment #4 by mk — 2016-09-18T19:24:38Z
*** Issue 13820 has been marked as a duplicate of this issue. ***