提交 268c969a 编写于 作者: V vsadov

Fix build after merge

上级 8ec04c1d
#!/bin/sh
THISDIR=$(dirname $0)
# CoreCLR / CoreFX does not execute reliably with an unlimited
# stack. Make on Linux can execute child processes with an
# unlimited stack so force it back to a known good limit
#
# https://github.com/dotnet/coreclr/issues/2467
ulimit -s 8192
chmod +x $THISDIR/corerun 2>/dev/null
$THISDIR/corerun $THISDIR/csc.exe "$@"
echo off
%~dp0\corerun.exe %~dp0\csc.exe %*
......@@ -207,7 +207,7 @@ private BoundExpression CheckValue(BoundExpression expr, BindValueKind valueKind
if (!resolvedToMethodGroup)
{
Debug.Assert(methodGroup.ResultKind != LookupResultKind.Viable);
BoundNode receiver = methodGroup.ReceiverOpt;
var receiver = methodGroup.ReceiverOpt;
if ((object)otherSymbol != null && receiver?.Kind == BoundKind.TypeOrValueExpression)
{
// Since we're not accessing a method, this can't be a Color Color case, so TypeOrValueExpression should not have been used.
......@@ -225,7 +225,7 @@ private BoundExpression CheckValue(BoundExpression expr, BindValueKind valueKind
expr.Syntax,
methodGroup.ResultKind,
(object)otherSymbol == null ? ImmutableArray<Symbol>.Empty : ImmutableArray.Create(otherSymbol),
receiver == null ? ImmutableArray<BoundNode>.Empty : ImmutableArray.Create(receiver),
receiver == null ? ImmutableArray<BoundExpression>.Empty : ImmutableArray.Create(receiver),
GetNonMethodMemberType(otherSymbol));
}
}
......
......@@ -3063,7 +3063,7 @@ private TypeSymbol StackMergeType(BoundExpression expr)
if (conversionKind.IsImplicitConversion() &&
conversionKind != ConversionKind.MethodGroup &&
conversionKind != ConversionKind.NullLiteral)
conversionKind != ConversionKind.DefaultOrNullLiteral)
{
return StackMergeType(conversion.Operand);
}
......
......@@ -1432,7 +1432,7 @@ private bool ShouldAsyncBeTreatedAsModifier(bool parsingStatementNotDeclaration)
// "async TypeName class". In this case, we just have an incomplete member before
// an existing type declaration. Treat this 'async' as a keyword.
if (CanStartTypeDeclaration(this.CurrentToken.Kind))
if (IsTypeDeclarationStart())
{
return true;
}
......
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp7_1 = 701 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts
Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.ReadOnlyKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken
Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax.WithReadOnlyKeyword(Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax
Microsoft.CodeAnalysis.CSharp.SyntaxKind.ConflictMarkerTrivia = 8564 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
Microsoft.CodeAnalysis.CSharp.SyntaxKind.DefaultLiteralExpression = 8755 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
static Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.TryParseLanguageVersion(string value, out Microsoft.CodeAnalysis.CSharp.LanguageVersion version) -> bool
static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.MapSpecifiedToEffectiveVersion(this Microsoft.CodeAnalysis.CSharp.LanguageVersion version) -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.ToDisplayString(this Microsoft.CodeAnalysis.CSharp.LanguageVersion version) -> string
static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(this string version, out Microsoft.CodeAnalysis.CSharp.LanguageVersion result) -> bool
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefType(Microsoft.CodeAnalysis.SyntaxToken refKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type) -> Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeSyntax
static Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsReservedTupleElementName(string elementName) -> bool
static Microsoft.CodeAnalysis.CSharp.SyntaxFacts.TryGetInferredMemberName(this Microsoft.CodeAnalysis.SyntaxNode syntax) -> string
\ No newline at end of file
......@@ -49,7 +49,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
class Test
......@@ -114,7 +114,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
class Test
......@@ -179,7 +179,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
class Test
......@@ -236,7 +236,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
public delegate ref readonly int D(ref readonly int x);
......@@ -300,7 +300,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
public class Test
......@@ -375,7 +375,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
delegate ref readonly int D(ref readonly int x);
......@@ -415,7 +415,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
using System.Runtime.CompilerServices;
......@@ -424,7 +424,7 @@ public class ReadOnlyAttribute : System.Attribute { }
public delegate ref readonly int D([ReadOnly] ref readonly int x);
";
CreateCompilationWithMscorlib(codeB, references: new[] { referenceA }).VerifyDiagnostics(
CreateStandardCompilation(codeB, references: new[] { referenceA }).VerifyDiagnostics(
// (4,2): error CS8412: Do not use 'System.Runtime.CompilerServices.ReadOnlyAttribute'. This is reserved for compiler usage.
// [ReadOnly]
Diagnostic(ErrorCode.ERR_ExplicitReadOnlyAttr, "ReadOnly").WithLocation(4, 2),
......@@ -442,7 +442,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
using System.Runtime.CompilerServices;
......@@ -453,7 +453,7 @@ public class Test
}
";
CreateCompilationWithMscorlib(codeB, references: new[] { referenceA }).VerifyDiagnostics(
CreateStandardCompilation(codeB, references: new[] { referenceA }).VerifyDiagnostics(
// (4,2): error CS8412: Do not use 'System.Runtime.CompilerServices.ReadOnlyAttribute'. This is reserved for compiler usage.
// [ReadOnly]
Diagnostic(ErrorCode.ERR_ExplicitReadOnlyAttr, "ReadOnly").WithLocation(4, 2));
......@@ -468,7 +468,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
using System.Runtime.CompilerServices;
......@@ -482,7 +482,7 @@ public class Test
}
";
CreateCompilationWithMscorlib(codeB, references: new[] { referenceA }).VerifyDiagnostics(
CreateStandardCompilation(codeB, references: new[] { referenceA }).VerifyDiagnostics(
// (6,6): error CS8412: Do not use 'System.Runtime.CompilerServices.ReadOnlyAttribute'. This is reserved for compiler usage.
// [ReadOnly]
Diagnostic(ErrorCode.ERR_ExplicitReadOnlyAttr, "ReadOnly").WithLocation(6, 6));
......@@ -497,7 +497,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
using System.Runtime.CompilerServices;
......@@ -511,7 +511,7 @@ public class Test
}
";
CreateCompilationWithMscorlib(codeB, references: new[] { referenceA }).VerifyDiagnostics(
CreateStandardCompilation(codeB, references: new[] { referenceA }).VerifyDiagnostics(
// (8,6): error CS8412: Do not use 'System.Runtime.CompilerServices.ReadOnlyAttribute'. This is reserved for compiler usage.
// [ReadOnly]
Diagnostic(ErrorCode.ERR_ExplicitReadOnlyAttr, "ReadOnly").WithLocation(8, 6));
......@@ -526,7 +526,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
using System.Runtime.CompilerServices;
......@@ -563,7 +563,7 @@ namespace System.Runtime.CompilerServices
public class ReadOnlyAttribute : System.Attribute { }
}";
var referenceA = CreateCompilationWithMscorlib(codeA).VerifyDiagnostics().ToMetadataReference();
var referenceA = CreateStandardCompilation(codeA).VerifyDiagnostics().ToMetadataReference();
var codeB = @"
using System.Runtime.CompilerServices;
......@@ -575,7 +575,7 @@ public class Test
}
";
CreateCompilationWithMscorlib(codeB, references: new[] { referenceA }).VerifyDiagnostics(
CreateStandardCompilation(codeB, references: new[] { referenceA }).VerifyDiagnostics(
// (6,6): error CS8412: Do not use 'System.Runtime.CompilerServices.ReadOnlyAttribute'. This is reserved for compiler usage.
// [ReadOnly]
Diagnostic(ErrorCode.ERR_ExplicitReadOnlyAttr, "ReadOnly").WithLocation(6, 6),
......
......@@ -1333,7 +1333,7 @@ abstract class TestClass
public void Method(ref readonly int x) { }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (5,17): error CS0663: 'TestClass' cannot define an overloaded method that differs only on parameter modifiers 'in' and 'ref'
// public void Method(ref readonly int x) { }
Diagnostic(ErrorCode.ERR_OverloadRefKind, "Method").WithArguments("TestClass", "method", "in", "ref").WithLocation(5, 17));
......@@ -1350,7 +1350,7 @@ abstract class TestClass
public void Method(ref readonly int x) { }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (5,17): error CS0663: 'TestClass' cannot define an overloaded method that differs only on parameter modifiers 'in' and 'out'
// public void Method(ref readonly int x) { }
Diagnostic(ErrorCode.ERR_OverloadRefKind, "Method").WithArguments("TestClass", "method", "in", "out").WithLocation(5, 17));
......
......@@ -5501,7 +5501,7 @@ public class C
public ref readonly int P => ref _p;
public ref readonly int this[in int i] => ref _p;
}";
var compA = CreateCompilationWithMscorlib(sourceA);
var compA = CreateStandardCompilation(sourceA);
compA.VerifyDiagnostics();
var refA = compA.EmitToImageReference();
// From C# symbols.
......@@ -5527,7 +5527,7 @@ public class C
public ref readonly int P => ref _p;
public ref readonly int this[ref readonly int i] => ref _p;
}";
var compA = CreateCompilationWithMscorlib(sourceA);
var compA = CreateStandardCompilation(sourceA);
compA.VerifyDiagnostics();
var refA = compA.EmitToImageReference();
// From C# symbols.
......
......@@ -834,7 +834,7 @@ interface B : A
void M(ref readonly int x);
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,10): warning CS0108: 'B.M(in int)' hides inherited member 'A.M(in int)'. Use the new keyword if hiding was intended.
// void M(ref readonly int x);
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M(in int)", "A.M(in int)").WithLocation(8, 10));
......@@ -863,7 +863,7 @@ interface B : A
ref readonly int M();
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,22): warning CS0108: 'B.M()' hides inherited member 'A.M()'. Use the new keyword if hiding was intended.
// ref readonly int M();
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M()", "A.M()").WithLocation(8, 22));
......@@ -892,7 +892,7 @@ interface B : A
ref readonly int M();
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,22): warning CS0108: 'B.M()' hides inherited member 'A.M()'. Use the new keyword if hiding was intended.
// ref readonly int M();
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M()", "A.M()").WithLocation(8, 22));
......@@ -921,7 +921,7 @@ interface B : A
ref int M();
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,13): warning CS0108: 'B.M()' hides inherited member 'A.M()'. Use the new keyword if hiding was intended.
// ref readonly int M();
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M()", "A.M()").WithLocation(8, 13));
......@@ -950,7 +950,7 @@ interface B : A
ref readonly int Property { get; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,22): warning CS0108: 'B.Property' hides inherited member 'A.Property'. Use the new keyword if hiding was intended.
// ref readonly int Property { get; }
Diagnostic(ErrorCode.WRN_NewRequired, "Property").WithArguments("B.Property", "A.Property").WithLocation(8, 22));
......@@ -979,7 +979,7 @@ interface B : A
ref int Property { get; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,13): warning CS0108: 'B.Property' hides inherited member 'A.Property'. Use the new keyword if hiding was intended.
// ref int Property { get; }
Diagnostic(ErrorCode.WRN_NewRequired, "Property").WithArguments("B.Property", "A.Property").WithLocation(8, 13));
......@@ -1008,7 +1008,7 @@ interface B : A
ref readonly int Property { get; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,22): warning CS0108: 'B.Property' hides inherited member 'A.Property'. Use the new keyword if hiding was intended.
// ref readonly int Property { get; }
Diagnostic(ErrorCode.WRN_NewRequired, "Property").WithArguments("B.Property", "A.Property").WithLocation(8, 22));
......@@ -1037,7 +1037,7 @@ interface B : A
new void M(ref readonly int x);
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -1063,7 +1063,7 @@ interface B : A
new ref readonly int M();
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -1089,7 +1089,7 @@ interface B : A
new ref readonly int Property { get; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aProperty = comp.GetMember<PropertySymbol>("A.Property");
var bProperty = comp.GetMember<PropertySymbol>("B.Property");
......@@ -1115,7 +1115,7 @@ class B : A
public void M(ref readonly int x) { }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
}
[Fact]
......@@ -1133,7 +1133,7 @@ class B : A
public ref readonly int M() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
}
[Fact]
......@@ -1151,7 +1151,7 @@ class B : A
public ref readonly int Property { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
}
[Fact]
......@@ -1168,7 +1168,7 @@ class B : A
public void M(ref int x) { }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (6,11): error CS0535: 'B' does not implement interface member 'A.M(in int)'
// class B : A
Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "A").WithArguments("B", "A.M(in int)").WithLocation(6, 11));
......@@ -1194,7 +1194,7 @@ class DerivedClass : BaseInterface
public ref readonly int this[int a] { get { return ref field; } }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics();
var comp = CreateStandardCompilation(text).VerifyDiagnostics();
}
[Fact]
......@@ -1213,7 +1213,7 @@ class ChildClass : BaseInterface
public void Method2(ref int x) { }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (7,20): error CS0535: 'ChildClass' does not implement interface member 'BaseInterface.Method2(in int)'
// class ChildClass : BaseInterface
Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "BaseInterface").WithArguments("ChildClass", "BaseInterface.Method2(in int)").WithLocation(7, 20),
......@@ -1239,7 +1239,7 @@ class ChildClass : BaseInterface
public ref int Method2() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (7,20): error CS8152: 'ChildClass' does not implement interface member 'BaseInterface.Method2()'. 'ChildClass.Method2()' cannot implement 'BaseInterface.Method2()' because it does not have matching return by reference.
// class ChildClass : BaseInterface
Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongRefReturn, "BaseInterface").WithArguments("ChildClass", "BaseInterface.Method2()", "ChildClass.Method2()").WithLocation(7, 20),
......@@ -1265,7 +1265,7 @@ class B : A
public ref int Property2 { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (7,11): error CS8152: 'B' does not implement interface member 'A.Property2'. 'B.Property2' cannot implement 'A.Property2' because it does not have matching return by reference.
// class B : A
Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongRefReturn, "A").WithArguments("B", "A.Property2", "B.Property2").WithLocation(7, 11),
......@@ -1289,7 +1289,7 @@ class B : A
public ref readonly int this[int p] { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (6,11): error CS8152: 'B' does not implement interface member 'A.this[int]'. 'B.this[int]' cannot implement 'A.this[int]' because it does not have matching return by reference.
// class B : A
Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongRefReturn, "A").WithArguments("B", "A.this[int]", "B.this[int]").WithLocation(6, 11));
......@@ -1310,7 +1310,7 @@ class B : A
public ref int this[int p] { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (6,11): error CS8152: 'B' does not implement interface member 'A.this[int]'. 'B.this[int]' cannot implement 'A.this[int]' because it does not have matching return by reference.
// class B : A
Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongRefReturn, "A").WithArguments("B", "A.this[int]", "B.this[int]").WithLocation(6, 11));
......@@ -1330,7 +1330,7 @@ class B : A
public int this[ref readonly int p] { get { return p; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
}
[Fact]
......@@ -1347,7 +1347,7 @@ class B : A
public int this[int p] { get { return p; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (6,11): error CS0535: 'B' does not implement interface member 'A.this[in int]'
// class B : A
Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "A").WithArguments("B", "A.this[in int]").WithLocation(6, 11));
......@@ -1367,7 +1367,7 @@ class B : A
public int this[ref readonly int p] { get { return p; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (6,11): error CS0535: 'B' does not implement interface member 'A.this[int]'
// class B : A
Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "A").WithArguments("B", "A.this[int]").WithLocation(6, 11));
......
......@@ -3999,7 +3999,7 @@ class B : A
public void M(ref readonly int x) { }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,17): warning CS0108: 'B.M(in int)' hides inherited member 'A.M(in int)'. Use the new keyword if hiding was intended.
// public void M(ref readonly int x) { }
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M(in int)", "A.M(in int)").WithLocation(8, 17));
......@@ -4029,7 +4029,7 @@ class B : A
public ref readonly int M() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,29): warning CS0108: 'B.M()' hides inherited member 'A.M()'. Use the new keyword if hiding was intended.
// public ref readonly int M() { return ref x; }
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M()", "A.M()").WithLocation(9, 29));
......@@ -4059,7 +4059,7 @@ class B : A
public ref readonly int M() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,29): warning CS0108: 'B.M()' hides inherited member 'A.M()'. Use the new keyword if hiding was intended.
// public ref readonly int M() { return ref x; }
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M()", "A.M()").WithLocation(9, 29));
......@@ -4089,7 +4089,7 @@ class B : A
public ref int M() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,20): warning CS0108: 'B.M()' hides inherited member 'A.M()'. Use the new keyword if hiding was intended.
// public ref int M() { return ref x; }
Diagnostic(ErrorCode.WRN_NewRequired, "M").WithArguments("B.M()", "A.M()").WithLocation(9, 20));
......@@ -4119,7 +4119,7 @@ class B : A
public ref readonly int Property { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,29): warning CS0108: 'B.Property' hides inherited member 'A.Property'. Use the new keyword if hiding was intended.
// public ref readonly int Property { get { return ref x; } }
Diagnostic(ErrorCode.WRN_NewRequired, "Property").WithArguments("B.Property", "A.Property").WithLocation(9, 29));
......@@ -4149,7 +4149,7 @@ class B : A
public ref int Property { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,20): warning CS0108: 'B.Property' hides inherited member 'A.Property'. Use the new keyword if hiding was intended.
// public ref int Property { get { return ref x; } }
Diagnostic(ErrorCode.WRN_NewRequired, "Property").WithArguments("B.Property", "A.Property").WithLocation(9, 20));
......@@ -4179,7 +4179,7 @@ class B : A
public ref readonly int Property { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,29): warning CS0108: 'B.Property' hides inherited member 'A.Property'. Use the new keyword if hiding was intended.
// public ref readonly int Property { get { return ref x; } }
Diagnostic(ErrorCode.WRN_NewRequired, "Property").WithArguments("B.Property", "A.Property").WithLocation(9, 29));
......@@ -4208,7 +4208,7 @@ class B : A
public new void M(ref readonly int x) { }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -4235,7 +4235,7 @@ class B : A
public new ref readonly int M() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -4262,7 +4262,7 @@ class B : A
public new ref readonly int Property { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aProperty = comp.GetMember<PropertySymbol>("A.Property");
var bProperty = comp.GetMember<PropertySymbol>("B.Property");
......@@ -4288,7 +4288,7 @@ class B : A
public override void M(ref readonly int x) { }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -4315,7 +4315,7 @@ class B : A
public override ref readonly int M() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -4342,7 +4342,7 @@ class B : A
public override ref readonly int Property { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aProperty = comp.GetMember<PropertySymbol>("A.Property");
var bProperty = comp.GetMember<PropertySymbol>("B.Property");
......@@ -4368,7 +4368,7 @@ class B : A
public void M(ref int x) { }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
var aMethod = comp.GetMember<MethodSymbol>("A.M");
var bMethod = comp.GetMember<MethodSymbol>("B.M");
......@@ -4402,7 +4402,7 @@ class DerivedClass : BaseClass
public override ref readonly int this[int a] { get { return ref field; } }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics();
var comp = CreateStandardCompilation(text).VerifyDiagnostics();
var baseMethod = comp.GetMember<MethodSymbol>("BaseClass.Method1");
var baseProperty = comp.GetMember<PropertySymbol>("BaseClass.Property1");
......@@ -4447,7 +4447,7 @@ class ChildClass : BaseClass
public override void Method2(ref int x) { }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (10,26): error CS0115: 'ChildClass.Method2(ref int)': no suitable method found to override
// public override void Method2(ref int x) { }
Diagnostic(ErrorCode.ERR_OverrideNotExpected, "Method2").WithArguments("ChildClass.Method2(ref int)").WithLocation(10, 26),
......@@ -4473,7 +4473,7 @@ class ChildClass : BaseClass
public override ref int Method2() { return ref x; }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (11,29): error CS8148: 'ChildClass.Method2()' must match by reference return of overridden member 'BaseClass.Method2()'
// public override ref int Method2() { return ref x; }
Diagnostic(ErrorCode.ERR_CantChangeRefReturnOnOverride, "Method2").WithArguments("ChildClass.Method2()", "BaseClass.Method2()").WithLocation(11, 29),
......@@ -4499,7 +4499,7 @@ class B : A
public override ref int Property2 { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (11,29): error CS8148: 'B.Property2' must match by reference return of overridden member 'A.Property2'
// public override ref int Property2 { get { return ref x; } }
Diagnostic(ErrorCode.ERR_CantChangeRefReturnOnOverride, "Property2").WithArguments("B.Property2", "A.Property2").WithLocation(11, 29),
......@@ -4523,7 +4523,7 @@ class B : A
public override ref readonly int this[int p] { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,38): error CS8148: 'B.this[int]' must match by reference return of overridden member 'A.this[int]'
// public override ref readonly int this[int p] { get { return ref x; } }
Diagnostic(ErrorCode.ERR_CantChangeRefReturnOnOverride, "this").WithArguments("B.this[int]", "A.this[int]").WithLocation(9, 38));
......@@ -4544,7 +4544,7 @@ class B : A
public override ref int this[int p] { get { return ref x; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (9,29): error CS8148: 'B.this[int]' must match by reference return of overridden member 'A.this[int]'
// public override ref int this[int p] { get { return ref x; } }
Diagnostic(ErrorCode.ERR_CantChangeRefReturnOnOverride, "this").WithArguments("B.this[int]", "A.this[int]").WithLocation(9, 29));
......@@ -4564,7 +4564,7 @@ class B : A
public override int this[ref readonly int p] { get { return p; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics();
var comp = CreateStandardCompilation(code).VerifyDiagnostics();
}
[Fact]
......@@ -4581,7 +4581,7 @@ class B : A
public override int this[int p] { get { return p; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,25): error CS0115: 'B.this[int]': no suitable method found to override
// public override int this[int p] { get { return p; } }
Diagnostic(ErrorCode.ERR_OverrideNotExpected, "this").WithArguments("B.this[int]").WithLocation(8, 25),
......@@ -4604,7 +4604,7 @@ class B : A
public override int this[ref readonly int p] { get { return p; } }
}";
var comp = CreateCompilationWithMscorlib(code).VerifyDiagnostics(
var comp = CreateStandardCompilation(code).VerifyDiagnostics(
// (8,25): error CS0115: 'B.this[in int]': no suitable method found to override
// public override int this[ref readonly int p] { get { return p; } }
Diagnostic(ErrorCode.ERR_OverrideNotExpected, "this").WithArguments("B.this[in int]").WithLocation(8, 25),
......
......@@ -322,7 +322,7 @@ class C
{
public ref readonly int P1 { get; set; }
}";
var comp = CreateCompilationWithMscorlib(text).VerifyDiagnostics(
var comp = CreateStandardCompilation(text).VerifyDiagnostics(
// (4,29): error CS8145: Auto-implemented properties cannot return by reference
// public ref readonly int P1 { get; set; }
Diagnostic(ErrorCode.ERR_AutoPropertyCannotBeRefReturning, "P1").WithArguments("C.P1").WithLocation(4, 29),
......
......@@ -19782,7 +19782,7 @@ .module ForwarderModule.dll
.assembly extern D2
}";
var ilModule = GetILModuleReference(ilSource, appendDefaultHeader: false);
var ilModule = GetILModuleReference(ilSource, prependDefaultHeader: false);
CreateStandardCompilation(string.Empty, references: new MetadataReference[] { ilModule }, assemblyName: "Forwarder").VerifyDiagnostics(
// error CS8406: Module 'ForwarderModule.dll' in assembly 'Forwarder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is forwarding the type 'Testspace.TestType' to multiple assemblies: 'D1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'D2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Diagnostic(ErrorCode.ERR_TypeForwardedToMultipleAssemblies).WithArguments("ForwarderModule.dll", "Forwarder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "Testspace.TestType", "D1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "D2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null").WithLocation(1, 1));
......
......@@ -41,6 +41,7 @@ Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBloc
Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockStartActionsCount.get -> int
Microsoft.CodeAnalysis.Diagnostics.Telemetry.AnalyzerTelemetryInfo.OperationBlockStartActionsCount.set -> void
Microsoft.CodeAnalysis.Emit.EmitOptions.EmitOptions(bool metadataOnly = false, Microsoft.CodeAnalysis.Emit.DebugInformationFormat debugInformationFormat = (Microsoft.CodeAnalysis.Emit.DebugInformationFormat)0, string pdbFilePath = null, string outputNameOverride = null, int fileAlignment = 0, ulong baseAddress = 0, bool highEntropyVirtualAddressSpace = false, Microsoft.CodeAnalysis.SubsystemVersion subsystemVersion = default(Microsoft.CodeAnalysis.SubsystemVersion), string runtimeMetadataVersion = null, bool tolerateErrors = false, bool includePrivateMembers = true, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind> instrumentationKinds = default(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Emit.InstrumentationKind>)) -> void
Microsoft.CodeAnalysis.IMethodSymbol.ReturnsByRefReadonly.get -> bool
Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.IOperation.Accept(Microsoft.CodeAnalysis.Semantics.OperationVisitor visitor) -> void
Microsoft.CodeAnalysis.IOperation.Accept<TArgument, TResult>(Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult> visitor, TArgument argument) -> TResult
......@@ -49,6 +50,7 @@ Microsoft.CodeAnalysis.IOperation.IsInvalid.get -> bool
Microsoft.CodeAnalysis.IOperation.Kind.get -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.IOperation.Syntax.get -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.IOperation.Type.get -> Microsoft.CodeAnalysis.ITypeSymbol
Microsoft.CodeAnalysis.IPropertySymbol.ReturnsByRefReadonly.get -> bool
Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.AddressOfExpression = 515 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.Argument = 1031 -> Microsoft.CodeAnalysis.OperationKind
......@@ -128,6 +130,7 @@ Microsoft.CodeAnalysis.OperationKind.YieldBreakStatement = 12 -> Microsoft.CodeA
Microsoft.CodeAnalysis.OperationKind.YieldReturnStatement = 16 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.ParseOptions.Errors.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>
Microsoft.CodeAnalysis.ParseOptions.SpecifiedKind.get -> Microsoft.CodeAnalysis.SourceCodeKind
Microsoft.CodeAnalysis.RefKind.RefReadOnly = 3 -> Microsoft.CodeAnalysis.RefKind
Microsoft.CodeAnalysis.SemanticModel.GetOperation(Microsoft.CodeAnalysis.SyntaxNode node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.ArgumentKind
Microsoft.CodeAnalysis.Semantics.ArgumentKind.DefaultValue = 3 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
......
......@@ -525,7 +525,7 @@ internal static class WellKnownTypes
"Microsoft.CodeAnalysis.Runtime.Instrumentation",
"System.Runtime.CompilerServices.ReferenceAssemblyAttribute"
"System.Runtime.CompilerServices.ReferenceAssemblyAttribute",
"System.Runtime.CompilerServices.ReadOnlyAttribute",
"System.Runtime.CompilerServices.IsByRefLikeAttribute",
......
......@@ -66,7 +66,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="$(MicrosoftNETCoreAppVersion)" />
<PackageReference Include="System.Runtime.Loader" Version="$(SystemRuntimeLoaderVersion)" />
</ItemGroup>
......
#!/bin/sh
THISDIR=$(dirname $0)
# CoreCLR / CoreFX does not execute reliably with an unlimited
# stack. Make on Linux can execute child processes with an
# unlimited stack so force it back to a known good limit
#
# https://github.com/dotnet/coreclr/issues/2467
ulimit -s 8192
chmod +x $THISDIR/corerun 2>/dev/null
$THISDIR/corerun $THISDIR/vbc.exe "$@"
echo off
%~dp0\corerun.exe %~dp0\vbc.exe %*
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册