Bug 24573 – qualified identifiers confuse IFTI

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-05-29T10:22:50Z
Last change time
2024-12-13T19:35:29Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
basile-z
Moved to GitHub: dmd#20461 →

Comments

Comment #0 by b2.temp — 2024-05-29T10:22:50Z
This code is rejected ``` module m; struct Tuple(T) { T t; } auto tuple(T)(T t) { return Tuple!T(t); } void test(T)(m.Tuple!T t) // here { } void main() { test(tuple(0.1)); } ``` because IFTI fails to infer `T`, but if you remove the `m` of the `test` parameter, it works. Test case is simplified from https://forum.dlang.org/post/[email protected] but that should be the same problem.
Comment #1 by b2.temp — 2024-05-29T12:30:04Z
The error message is > Error: undefined identifier `T` It's probable that IFTI actually works but when the time comes to run the semantics of `m.Tuple!T`, the scope used is wrong.
Comment #2 by robert.schadek — 2024-12-13T19:35:29Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20461 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB