KEMBAR78
Clone of Test_IndexerWithNoRequiredParameters for params collections fails · Issue #72227 · dotnet/roslyn · GitHub
Skip to content

Clone of Test_IndexerWithNoRequiredParameters for params collections fails #72227

@AlekseyTs

Description

@AlekseyTs
        <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)

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions