Bug 19181 – Semantic errors in opDispatch argument lead to "no property X"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-08-20T06:06:44Z
Last change time
2018-08-30T06:24:45Z
Assigned to
No Owner
Creator
FeepingCreature
See also
https://issues.dlang.org/show_bug.cgi?id=14145

Comments

Comment #0 by default_357-line — 2018-08-20T06:06:44Z
$ dmd test.d test.d(9): Error: no property foo for type S --- module test; struct S { void opDispatch(string name, T)(T arg) { } } void main() { S s; s.foo(LanguageError); } --- Note that as compared to Issue 14145, the problem here is that the *call* to opDispatch doesn't even compile, which should surely error on its own. There is no way that opDispatch can be written that makes this code valid.
Comment #1 by github-bugzilla — 2018-08-20T19:09:40Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/4ea34855e59b42efe29cc3475df81ce0046051b2 Fix Issue 19181: when an UFCS or opDispatch call has syntactically invalid arguments, always error. https://github.com/dlang/dmd/commit/c2317ad3b7401dc9fe26a28cca66846a892d5d34 Merge pull request #8584 from FeepingCreature/fix/Issue-19181-error-on-invalid-arguments-in-ufcs-opDispatch Fix Issue 19181: always error when an UFCS or opDispatch call has syntactically invalid arguments merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
Comment #2 by github-bugzilla — 2018-08-30T06:24:45Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3b4f0209b69be737ba52659313ecca8cce13f86c Merge pull request #8584 from FeepingCreature/fix/Issue-19181-error-on-invalid-arguments-in-ufcs-opDispatch Fix Issue 19181: always error when an UFCS or opDispatch call has syntactically invalid arguments merged-on-behalf-of: Sebastian Wilzbach <[email protected]> https://github.com/dlang/dmd/commit/5647788e6776b2f6f4cc32c6e0a6b90ffa121a12 Merge pull request #8588 from FeepingCreature/fix/Issue-19181-error-immediately-on-invalid-arguments-to-opDispatch [stable] [from master] Issue 19181: when an UFCS or opDispatch call has syntactically invalid arguments, always error.