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

GenerateTypeTests.TestGenerateVarType broken by #7515 #7516

Closed
gafter opened this issue Dec 16, 2015 · 10 comments
Closed

GenerateTypeTests.TestGenerateVarType broken by #7515 #7516

gafter opened this issue Dec 16, 2015 · 10 comments
Assignees
Milestone

Comments

@gafter
Copy link
Member

gafter commented Dec 16, 2015

The test GenerateTypeTests.TestGenerateVarType is broken by #7515. Can someone on the IDE team please help me diagnose this?

The branch to work from is https://github.com/gafter/roslyn/tree/fix7387

@gafter
Copy link
Member Author

gafter commented Dec 16, 2015

Here is the symptom:

------ Test started: Assembly: Roslyn.Services.Editor.CSharp.UnitTests.dll ------

Unknown .NET Framework Version: v4.6

Test 'Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.GenerateTypeTests.GenerateTypeTests.TestGenerateVarType' failed:
    Assert.NotNull() Failure
    CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs(306,0): at Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions.AbstractCodeActionOrUserDiagnosticTest.<VerifyInputsAndGetOperationsAsync>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs(212,0): at Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions.AbstractCodeActionOrUserDiagnosticTest.<TestActionsAsync>d__16.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs(198,0): at Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions.AbstractCodeActionOrUserDiagnosticTest.<TestAsync>d__15.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs(162,0): at Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions.AbstractCodeActionOrUserDiagnosticTest.<TestAsync>d__13.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    Diagnostics\GenerateType\GenerateTypeTests.cs(1388,0): at Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.GenerateTypeTests.GenerateTypeTests.<TestGenerateVarType>d__138.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

7779 passed, 1 failed, 24 skipped (see 'Task List'), took 524.00 seconds (xUnit.net 2.1.0 build 3179).

@Pilchie
Copy link
Member

Pilchie commented Dec 16, 2015

@dotnet/roslyn-ide: Anyone have any ideas of the top?

@CyrusNajmabadi
Copy link
Member

Let me debug through this to find out.

@leppie
Copy link
Contributor

leppie commented Dec 16, 2015

@CyrusNajmabadi I already found the problem/fix, see #7515 (comment)

@CyrusNajmabadi
Copy link
Member

Hey Neal, the issue here is that "@var" is misclassified by the compiler as the "var" keyword. Causing the following error to be emitted instead:

"test1.cs(1,41): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code"

I'm not sure what the reason for that is, but it seems useful to have a test that validates that @var doesn't produce that error in the compiler layer. Once that gets fixed up, the IDE test will likely succeed again.

@CyrusNajmabadi
Copy link
Member

Hi @leppie Thanks for the investigation as well. Looks like we both found it at the same time :)

@Pilchie
Copy link
Member

Pilchie commented Dec 18, 2015

Moving to compiler based on the investigations above.

@jaredpar
Copy link
Member

@gafter the PR which should have fixed this (#7515) was closed apparently without merging. Is this bug still active? If so why did we close down the PR?

@jaredpar jaredpar added Need More Info The issue needs more information to proceed. Bug and removed Need More Info The issue needs more information to proceed. labels Jan 18, 2016
@jaredpar jaredpar added this to the 1.2 milestone Jan 18, 2016
@NoneGiven
Copy link

@jaredpar Commit cc10b52 made by @gafter merged the changes from that PR (see "closed this in" at the bottom).

@jaredpar
Copy link
Member

@NoneGiven thanks!

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

6 participants