未验证 提交 b494eecf 编写于 作者: M msftbot[bot] 提交者: GitHub

Merge pull request #41832 from dotnet/merges/release/dev16.5-to-master

Merge release/dev16.5 to master
......@@ -159,11 +159,9 @@ private TypeSymbol DecodeType(TypeSymbol type)
switch (type.Kind)
{
case SymbolKind.ErrorType:
if (type.HasUseSiteError)
{
_foundUsableErrorType = true;
}
_foundUsableErrorType = true;
return type;
case SymbolKind.DynamicType:
case SymbolKind.TypeParameter:
case SymbolKind.PointerType:
......
......@@ -26095,6 +26095,36 @@ public static void Main()
CompileAndVerify(executeComp, expectedOutput: "ran");
}
[Fact]
[WorkItem(41699, "https://github.com/dotnet/roslyn/issues/41699")]
public void MissingBaseType_TupleTypeArgumentWithNames()
{
var sourceA =
@"public class A<T> { }";
var comp = CreateCompilation(sourceA, assemblyName: "A");
var refA = comp.EmitToImageReference();
var sourceB =
@"public class B : A<(object X, B Y)> { }";
comp = CreateCompilation(sourceB, references: new[] { refA });
var refB = comp.EmitToImageReference();
var sourceC =
@"class Program
{
static void Main()
{
var b = new B();
b.ToString();
}
}";
comp = CreateCompilation(sourceC, references: new[] { refB });
comp.VerifyDiagnostics(
// (6,11): error CS0012: The type 'A<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
// b.ToString();
Diagnostic(ErrorCode.ERR_NoTypeDef, "ToString").WithArguments("A<>", "A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(6, 11));
}
[Fact]
[WorkItem(21727, "https://github.com/dotnet/roslyn/issues/21727")]
public void FailedDecodingOfTupleNamesWhenMissingValueTupleType()
......@@ -126,10 +126,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE
Private Function DecodeType(type As TypeSymbol) As TypeSymbol
Select Case type.Kind
Case SymbolKind.ErrorType
If type.GetUseSiteErrorInfo() IsNot Nothing Then
_foundUsableErrorType = True
End If
_foundUsableErrorType = True
Return type
Case SymbolKind.DynamicType,
......
......@@ -22800,6 +22800,39 @@ End Class
End Sub
<Fact>
<WorkItem(41699, "https://github.com/dotnet/roslyn/issues/41699")>
Public Sub MissingBaseType_TupleTypeArgumentWithNames()
Dim sourceA =
"Public Class A(Of T)
End Class"
Dim comp = CreateCompilation(sourceA, assemblyName:="A")
Dim refA = comp.EmitToImageReference()
Dim sourceB =
"Public Class B
Inherits A(Of (X As Object, Y As B))
End Class"
comp = CreateCompilation(sourceB, references:={refA})
Dim refB = comp.EmitToImageReference()
Dim sourceC =
"Module Program
Sub Main()
Dim b = New B()
b.ToString()
End Sub
End Module"
comp = CreateCompilation(sourceC, references:={refB})
comp.AssertTheseDiagnostics(
"BC30456: 'ToString' is not a member of 'B'.
b.ToString()
~~~~~~~~~~
BC30652: Reference required to assembly 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'A(Of )'. Add one to your project.
b.ToString()
~~~~~~~~~~")
End Sub
<Fact>
<WorkItem(41207, "https://github.com/dotnet/roslyn/issues/41207")>
<WorkItem(1056281, "https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1056281")>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册