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 |
This test was missing a
WpfFactattribute. When added, the test was failing.roslyn/src/EditorFeatures/Test2/Diagnostics/GenerateFromUsage/GenerateMethodCrossLanguageTests.vb
Lines 744 to 830 in 27913e0