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

Can't "alias this" to a template instantiation #18776

Open
dlangBugzillaToGithub opened this issue Feb 19, 2014 · 2 comments
Open

Can't "alias this" to a template instantiation #18776

dlangBugzillaToGithub opened this issue Feb 19, 2014 · 2 comments

Comments

@dlangBugzillaToGithub
Copy link

Vladimir Panteleev (@CyberShadow) reported this on 2014-02-19T15:43:46Z

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

CC List

  • RazvanN
  • Marc Schütz

Description

template T()
{
	void foo() {}
}

struct S
{
	alias t = T!();
	alias t this;
}

void main()
{
	S s;
	s.foo();
}
@dlangBugzillaToGithub
Copy link
Author

schuetzm commented on 2015-03-15T16:33:45Z

Still there in DMD master. The error message is:

xx.d(15): Error: expression has no value

@dlangBugzillaToGithub
Copy link
Author

razvan.nitu1305 commented on 2018-10-19T14:01:25Z

This is a weird case. The alias is part of the struct, but the actual function is not. I would say that the correct behavior is the current one:

Error : no property foo for type S.

Note that writing s.t.foo works. In my opinion, this is the real bug.

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