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

Using Self::EnumVariant fails #53414

Closed
varkor opened this issue Aug 16, 2018 · 2 comments
Closed

Using Self::EnumVariant fails #53414

varkor opened this issue Aug 16, 2018 · 2 comments

Comments

@varkor
Copy link
Member

varkor commented Aug 16, 2018

enum Enum {
    Variant,
}

impl Enum {
    fn choose() -> Self {
        Self::Variant //~ ERROR no variant named `Variant` found for type `Enum` in the current scope
    }
}

I'm not sure if this is supposed to be allowed or not, but the error message is incorrect. Is there an up-to-date document describing all the places Self is allowed instead of a type name?

@Havvy
Copy link
Contributor

Havvy commented Aug 16, 2018

This is #49683

@varkor
Copy link
Member Author

varkor commented Aug 16, 2018

Thanks, I tried searching but managed to overlook this!

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

3 participants