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

libdparse fails parsing alias foo = this #258

Closed
wilzbach opened this issue Aug 8, 2018 · 2 comments
Closed

libdparse fails parsing alias foo = this #258

wilzbach opened this issue Aug 8, 2018 · 2 comments

Comments

@wilzbach
Copy link
Member

wilzbach commented Aug 8, 2018

Found in func.d at dmd.
Minimized:

class F {
    bool equals()
    {
        alias fd1 = this;
    }
}
@ghost
Copy link

ghost commented Aug 8, 2018

It's because this as a type has been removed in #250. Specs say that

Type aliases can sometimes look indistinguishable from alias declarations:
The distinction is made in the semantic analysis pass.

So i suppose the commit should be reverted. The idea here is then that this will alias to the instance, always, and never to typeof(this)

@ghost
Copy link

ghost commented Aug 8, 2018

No actually i see now that the PR was not merged.

@ghost ghost added bug parser labels Aug 8, 2018
dlang-bot added a commit that referenced this issue Aug 8, 2018
fix #258 - fail to parse `alias foo = this`
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
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