Skip to content

GenerateMethodCrossLanguageTests.GenerateMethodUsingTypeConstraint_3BaseTypeConstraints_CommonDerived does not pass #51818

@sharwell

Description

@sharwell

This test was missing a WpfFact attribute. When added, the test was failing.

Public Async Function GenerateMethodUsingTypeConstraint_3BaseTypeConstraints_CommonDerived() As Task
Dim input =
<Workspace>
<Project Language="Visual Basic" AssemblyName="VBAssembly1" CommonReferences="true">
<ProjectReference>CSAssembly1</ProjectReference>
<Document>
Module Program
Sub Main(args As String())
Dim list = New List(Of String)
list.AddRange($$goo())
End Sub
End Module
</Document>
</Project>
<Project Language="C#" AssemblyName="CSAssembly1" CommonReferences="true">
<Document FilePath=<%= DestinationDocument %>><![CDATA[
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
public static class extensions
{
public static void AddRange<T, U>(this List<T> list, MyStruct<U> items) where U : interface1, interface2, interface3
{
}
}
public struct MyStruct<T>
{
}
public interface interface1
{
}
public interface interface2
{
}
public class derived1 : interface1, interface2
{
}
public interface interface3
{
}
public class derived2 : interface3
{
}
public class outer
{
public class inner
{
public class derived3 : derived1, interface3
{
}
}
}]]>
</Document>
</Project>
</Workspace>
Dim expected =
<text><![CDATA[
Module Program
Sub Main(args As String())
Dim list = New List(Of String)
list.AddRange(goo())
End Sub
Private Function goo() As MyStruct(Of outer.inner.derived3)
Throw New NotImplementedException()
End Function
End Module]]>
</text>.Value.Trim()
Await TestAsync(input, expected, onAfterWorkspaceCreated:=Sub(w) w.SetTestLogger(AddressOf _outputHelper.WriteLine))
End Function

Metadata

Metadata

Assignees

Labels

Area-IDETestTest failures in roslyn-CIhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions