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
---