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

Fix parameter scoping on lambdas #60169

Closed
wants to merge 1 commit into from
Closed

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Mar 14, 2022

In working on nameof(parameter) feature (draft PR), I found a bug in scoping for lambda parameters. One-line fix.

TODO2 document breaking change

class C
{
    void M()
    {
        // error CS1503: Argument 1: cannot convert from 'int' to 'string'
        var _ = void ([My(parameter)] int parameter) => throw null;
    }
    // error CS0103: The name 'parameter' does not exist in the current context
    void M2([My(parameter)] int parameter) => throw null;
}
public class MyAttribute : System.Attribute
{
    public MyAttribute(string name1) { }
}

@jcouv
Copy link
Member Author

jcouv commented Mar 14, 2022

Will merge this fix into #60098

@jcouv jcouv closed this Mar 14, 2022
@jcouv jcouv deleted the nameof-scope3 branch March 14, 2022 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant