Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious "undefined identifier 'T'" when pattern-matching instantiation of fully qualified template #21008

Open
VPanteleev-S7 opened this issue Mar 16, 2025 · 1 comment

Comments

@VPanteleev-S7
Copy link

static import std.typecons;
import std.typecons : Nullable;

void a(T)(Nullable!T) {}
void b(T)(std.typecons.Nullable!T) {}

unittest
{
	Nullable!int i;
	a(i); // OK
	b(i); // Error: undefined identifier `T`
}
@baz-bg
Copy link

baz-bg commented Mar 17, 2025

reduced in a single module:

module m21008;

struct Nullable(T){}

void a(T)(Nullable!T) {}
void b(T)(m21008.Nullable!T) {}
void c(T)(.Nullable!T) {}

unittest
{
    Nullable!int i;
    a(i); // OK
    b(i); // Error: undefined identifier `T`
    c(i); // Error: undefined identifier `T`
}  

so hopefully that's only a IFTI bug, not related to imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants