-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Nested local functions causes KeyNotFoundException #21645
Comments
This seems to have been already fixed by #21367. That change is not included in 15.3, but should be in a future version. |
I'm getting the same error with a slightly different repro: class Class
{
public void Meth()
{
var x = 3;
{
var y = 4;
void Local()
{
Console.WriteLine(x);
Func<int> f = () => y;
}
Local();
}
}
} The key to the repro (at least in this case) appears to be having a local function inside a local function, each of which accesses a different local from two scopes out. |
agocke
added a commit
to agocke/roslyn
that referenced
this issue
Sep 14, 2017
agocke
added a commit
that referenced
this issue
Sep 15, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version Used:
Microsoft Visual Studio Enterprise 2017
Version 15.3.1
VisualStudio.15.Release/15.3.1+26730.8
Microsoft .NET Framework
Version 4.7.02046
Steps to Reproduce:
Example repository available here.
This same code does compile with VS 2017 v15.2 (26430.15 release).
Expected Behavior:
Compile succeeds without error.
Actual Behavior:
CSC.exe crash with error code -2146232797
MSBuild output:
Event view log:
Potentially related to #17814 and #16895?
The text was updated successfully, but these errors were encountered: