Bug 17240 – mutable/shared @property both match in typeof
Status
RESOLVED
Resolution
WORKSFORME
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-03-02T13:55:28Z
Last change time
2022-11-18T09:54:34Z
Assigned to
No Owner
Creator
John Colvin
Comments
Comment #0 by john.loughran.colvin — 2017-03-02T13:55:28Z
struct S
{
import std.stdio;
int b() @property { return 0; }
int b() @property const { return 0; }
int b() @property shared { return 0; }
}
alias T = typeof(S.b);
/d746/f453.d(9): Error: f453.S.b called with argument types () matches both:
/d746/f453.d(4): f453.S.b()
and:
/d746/f453.d(6): f453.S.b()
The problem doesn't occur without @property, whether or not () are included in the typeof expression.
The clash is to do with shared. const/shared clash, as do mutable/shared, but mutable/const is fine.
In order to add typeof(AggregateType.member) support to std.typecons.Proxy (with knockon improvements to a few other things in std.typecons), either this bug or https://issues.dlang.org/show_bug.cgi?id=17239 needs resolving.
Comment #1 by razvan.nitu1305 — 2022-11-18T09:54:34Z
I cannot reproduce this. Compiling the code with git master yields a successful compilation.