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

Clone of Test_IndexerWithNoRequiredParameters for params collections fails #72227

Closed
AlekseyTs opened this issue Feb 22, 2024 · 0 comments · Fixed by #76177
Closed

Clone of Test_IndexerWithNoRequiredParameters for params collections fails #72227

AlekseyTs opened this issue Feb 22, 2024 · 0 comments · Fixed by #76177

Comments

@AlekseyTs
Copy link
Contributor

        <Fact>
        Public Async Function Test_IndexerWithNoRequiredParameters_02() As Task
            Dim input =
                <Workspace>
                    <Project Language='C#' AssemblyName='CSharpAssembly1' CommonReferences='true'>
                        <Document FilePath='Test1.cs'>
using System.Collections.Generic;

public interface I
{
    int this[params IEnumerable&lt;int&gt; y] { get; }
}
                        </Document>
                    </Project>
                    <Project Language='Visual Basic' AssemblyName='VBAssembly1' CommonReferences='true'>
                        <ProjectReference>CSharpAssembly1</ProjectReference>
                        <Document>
Imports System.Collections.Generic

Class C
    Implements $$I
End Class
                        </Document>
                    </Project>
                </Workspace>

            Dim expected =
                <text>
Imports System.Collections.Generic

Class C
    Implements I
 
    Public ReadOnly Property Item(y As IEnumerable(Of Integer)) As Integer Implements I.Item
        Get
            Throw New NotImplementedException()
        End Get
    End Property
End Class
                </text>.Value.Trim()

            Await TestAsync(input, expected)
        End Function

Observed:

Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics.ImplementInterface.ImplementInterfaceCrossLanguageTests.Test_IndexerWithNoRequiredParameters_02 [FAIL]
  System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
    D:\GitHub\roslyn\src\EditorFeatures\Test2\Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb(75,0): at Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics.AbstractCrossLanguageUserDiagnosticTest.VB$StateMachine_10_TestAsync.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    D:\GitHub\roslyn\src\EditorFeatures\Test2\Diagnostics\ImplementInterface\ImplementInterfaceCrossLanguageTests.vb(268,0): at Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics.ImplementInterface.ImplementInterfaceCrossLanguageTests.VB$StateMachine_7_Test_IndexerWithNoRequiredParameters_02.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants