Bug 10456 – struct containing enum X, alias X this and a dynamic array no longer compiles since 2.063

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-23T17:09:00Z
Last change time
2013-06-28T06:09:44Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
gassa

Comments

Comment #0 by gassa — 2013-06-23T17:09:20Z
I have reduced my problematic code to this: ----- struct TheStruct { enum TheEnum {ELEMENT}; alias TheEnum this; int [] x; } ----- It produces the following errors: ----- Error: type TheEnum is not an expression Error: type TheEnum is not an expression ----- Notes: 1. Compiles fine with DMD 2.062. Gives the errors with 2.063 and 2.063.2. 2. It does print the error twice. 3. No file or line number in the message complicates debugging. 4. "int [] x" cannot be further reduced to "int x". Seems it has to be a dynamic array (of anything), associative array, a class or struct containing such an array, or something similar to produce the error. If TheStruct is a class instead of a struct, the error also vanishes in my case. Ivan Kazmenko.
Comment #1 by henning — 2013-06-24T06:03:37Z
Comment #2 by github-bugzilla — 2013-06-28T06:00:18Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a84fd39628a577723852dd4993061eda5303c1e1 fix issue 10456 - struct containing enum X, alias X this and a dynamic array no longer compiles since 2.063 https://github.com/D-Programming-Language/dmd/commit/ad0909d74e282f6589ff7adbd12ab14d91a5ef69 Merge pull request #2255 from hpohl/10456 [REG2.063] fix issue 10456 - struct containing enum X, alias X this and a dynamic array no longer compiles since 2.063
Comment #3 by github-bugzilla — 2013-06-28T06:08:50Z
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/97bdd75b81b8ee742be8f40e1a7761919a1a256e Merge pull request #2255 from hpohl/10456 [REG2.063] fix issue 10456 - struct containing enum X, alias X this and a dynamic array no longer compiles since 2.063 Conflicts: test/runnable/aliasthis.d