[Issue 23292] New: Import in template ignored during IFTI for eponymous member
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 12 20:55:42 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23292
Issue ID: 23292
Summary: Import in template ignored during IFTI for eponymous
member
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.100.0, the following example program fails to compile
--- lib.d
module lib;
struct S {}
--- app.d
module app;
template fun()
{
import lib;
void fun(S) {}
}
void main()
{
import lib;
S s;
fun(s);
}
---
The error message is:
---
app.d(6): Error: undefined identifier `S`
app.d(13): Error: none of the overloads of template `app.fun` are callable
using argument types `!()(S)`
app.d(3): Candidate is: `fun()(S)`
---
If the call expression `fun(s)` is changed to `fun!()(s)`, the program compiles
successfully.
--
More information about the Digitalmars-d-bugs
mailing list