Bug 17120 – error messages from wrong overload

Status
NEW
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-01-25T00:26:29Z
Last change time
2024-12-13T18:51:24Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
John Colvin
Moved to GitHub: dmd#19228 →

Comments

Comment #0 by john.loughran.colvin — 2017-01-25T00:26:29Z
struct S(size_t _) { // void foo(size_t i)(S!(i) rhs){} //OK void foo(size_t i)(S!(+i) rhs){} //Error void foo(){} } void main() { S!4 v1; v1.foo(); } test.d(4): Error: undefined identifier 'i' Also, if I comment out the `void foo(){}` overload the compiler still complains about the undefined identifier, but also prints the "cannot deduce function from argument types" as expected.
Comment #1 by robert.schadek — 2024-12-13T18:51:24Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19228 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB