Bug 19925 – static opDispatch not considered in WithStatement
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-05-31T08:40:57Z
Last change time
2020-03-21T03:56:38Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Simen Kjaeraas
Comments
Comment #0 by simen.kjaras — 2019-05-31T08:40:57Z
The below code does not compile, but should:
unittest {
with (S) {
a(); // Compiles!
b(); // Fails!
}
}
struct S {
static void a() {}
static void opDispatch(string name)() {}
}
To make it worse, this compiles:
unittest {
with (S.init) {
a(); // Compiles!
b(); // Compiles!
}
}
, showing that static methods are considered when looking up methods of an instance.
Comment #1 by dlang-bot — 2019-06-20T19:23:48Z
@Basile-z created dlang/dmd pull request #10068 "fix issue 19925 - static opDispatch not considered in WithStatement" fixing this issue:
- fix issue 19925 - static opDispatch not considered in WithStatement
https://github.com/dlang/dmd/pull/10068
Comment #2 by dlang-bot — 2019-06-21T00:41:06Z
dlang/dmd pull request #10068 "fix issue 19925 - static opDispatch not considered in WithStatement" was merged into master:
- c02ec07697dacfeb3778fc13ad449b2e259934f2 by The Dlang Bot:
fix issue 19925 - static opDispatch not considered in WithStatement
https://github.com/dlang/dmd/pull/10068