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

Type deduction fails with dependencies between parameter types #18593

Open
dlangBugzillaToGithub opened this issue Jun 1, 2013 · 0 comments
Open

Comments

@dlangBugzillaToGithub
Copy link

Peter Alexander (@Poita) reported this on 2013-06-01T04:10:17Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=10228

CC List

Description

This fails with the error: "undefined identifier T.Inner" in 2.063

void foo(T)(T x, T.Inner y) {}

struct Bar { alias int Inner; };

void main()
{
	foo(Bar(), 0);
}

Calling foo!Bar works.


I don't know if this is really a bug, or an enhancement request, but analogous code works in C++:

template <typename T>
void foo(T x, typename T::Inner y) {}

struct Bar { typedef int Inner; };

int main()
{
	foo(Bar(), 0);
	return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant