Bug 9858 – const alias this fails when opAssign is present

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-02T06:42:00Z
Last change time
2013-04-04T01:57:25Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2013-04-02T06:42:10Z
Works with 2.062. --- cat > test.d <<code struct S() { @property int get() const { return 42; } alias get this; void opAssign(int) {} } void main() { const S!() s; int i = s; } code dmd -c -o- test.d --- test.d(13): Error: cannot implicitly convert expression (s) of type const(S!()) to int ---
Comment #1 by k.hara.pg — 2013-04-02T19:12:49Z
Comment #2 by github-bugzilla — 2013-04-04T01:24:48Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c6ebfc21c8fd050b13dfd8cb2da8803797d261bc fix Issue 9858 - const alias this fails when opAssign is present Type::makeXXX had unintentionally taken over Type(Struct|Class)::att field. https://github.com/D-Programming-Language/dmd/commit/afd7c3d0555d7407bc55a2fb3e3dbf864413d23e Merge pull request #1828 from 9rnsr/fix9858 [REG2.063a] Issue 9858 - const alias this fails when opAssign is present