提交 cf032b40 编写于 作者: T Tomas Matousek 提交者: Jared Parsons

Fix build break

上级 5c1e7349
......@@ -19213,7 +19213,7 @@ public void CS0746ERR_InvalidAnonymousTypeMemberDeclarator_4()
public static int f1<T>() { return 1; }
}
";
CreateCompilationWithMscorlib(text).VerifyDiagnostics(
CreateStandardCompilation(text).VerifyDiagnostics(
// (3,22): error CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
// object F = new { f1<int> };
Diagnostic(ErrorCode.ERR_InvalidAnonymousTypeMemberDeclarator, "f1<int>").WithLocation(3, 22),
......
......@@ -5397,11 +5397,11 @@ class C
void M(__arglist, int j) {}
}";
CreateCompilationWithMscorlib(text1).VerifyDiagnostics(
CreateStandardCompilation(text1).VerifyDiagnostics(
// (4,11): error CS0231: A params parameter must be the last parameter in a formal parameter list
// void M(params int[] i, int j) {}
Diagnostic(ErrorCode.ERR_ParamsLast, "params int[] i").WithLocation(4, 11));
CreateCompilationWithMscorlib(text2).VerifyDiagnostics(
CreateStandardCompilation(text2).VerifyDiagnostics(
// (4,11): error CS0257: An __arglist parameter must be the last parameter in a formal parameter list
// void M(__arglist, int j) {}
Diagnostic(ErrorCode.ERR_VarargsLast, "__arglist").WithLocation(4, 11));
......
......@@ -343,7 +343,7 @@ public void Bar(__arglist, int b)
}
";
CreateCompilationWithMscorlib(test).VerifyDiagnostics(
CreateStandardCompilation(test).VerifyDiagnostics(
// (4,19): error CS0257: An __arglist parameter must be the last parameter in a formal parameter list
// public void Bar(__arglist, int b)
Diagnostic(ErrorCode.ERR_VarargsLast, "__arglist"));
......@@ -937,7 +937,7 @@ public static int Main()
}
";
CreateCompilationWithMscorlib(test).VerifyDiagnostics(
CreateStandardCompilation(test).VerifyDiagnostics(
// (7,23): error CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
// var t = new { a.b = 1 };
Diagnostic(ErrorCode.ERR_InvalidAnonymousTypeMemberDeclarator, "a.b = 1").WithLocation(7, 23),
......@@ -962,7 +962,7 @@ public static void Main()
}
}
";
CreateCompilationWithMscorlib(test).VerifyDiagnostics(
CreateStandardCompilation(test).VerifyDiagnostics(
// (7,23): error CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
// var t = new { s.Length = 1 };
Diagnostic(ErrorCode.ERR_InvalidAnonymousTypeMemberDeclarator, "s.Length = 1").WithLocation(7, 23),
......@@ -984,7 +984,7 @@ public static void Main()
}
}
";
CreateCompilationWithMscorlib(test).VerifyDiagnostics(
CreateStandardCompilation(test).VerifyDiagnostics(
// (7,23): error CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
// var t = new { s.ToString() = 1 };
Diagnostic(ErrorCode.ERR_InvalidAnonymousTypeMemberDeclarator, "s.ToString() = 1").WithLocation(7, 23),
......@@ -3802,7 +3802,7 @@ public class MyClass {
}
";
CreateCompilationWithMscorlib(test).VerifyDiagnostics(
CreateStandardCompilation(test).VerifyDiagnostics(
// (4,14): error CS1551: Indexers must have at least one parameter
// int this[] {
Diagnostic(ErrorCode.ERR_IndexerNeedsParam, "]").WithLocation(4, 14));
......
......@@ -1875,7 +1875,7 @@ public void TestEndBraceAfterIndexerParameterStart()
Assert.Equal((int)ErrorCode.ERR_LbraceExpected, file.Errors()[1].Code);
Assert.Equal((int)ErrorCode.ERR_RbraceExpected, file.Errors()[2].Code);
CreateCompilationWithMscorlib(text).VerifyDiagnostics(
CreateStandardCompilation(text).VerifyDiagnostics(
// (1,21): error CS1003: Syntax error, ']' expected
// class c { int this[ }
Diagnostic(ErrorCode.ERR_SyntaxError, "}").WithArguments("]", "}").WithLocation(1, 21),
......@@ -1987,7 +1987,7 @@ public void TestGarbageAfterIndexerParameterStart()
Assert.Equal(1, file.Errors().Length);
Assert.Equal((int)ErrorCode.ERR_UnexpectedCharacter, file.Errors()[0].Code);
CreateCompilationWithMscorlib(text).VerifyDiagnostics(
CreateStandardCompilation(text).VerifyDiagnostics(
// (1,21): error CS1056: Unexpected character '$'
// class c { int this[ $ ] { } }
Diagnostic(ErrorCode.ERR_UnexpectedCharacter, "").WithArguments("$").WithLocation(1, 21),
......@@ -2072,7 +2072,7 @@ public void TestMethodAfterIndexerParameterStart()
Assert.Equal((int)ErrorCode.ERR_LbraceExpected, file.Errors()[1].Code);
Assert.Equal((int)ErrorCode.ERR_RbraceExpected, file.Errors()[2].Code);
CreateCompilationWithMscorlib(text).VerifyDiagnostics(
CreateStandardCompilation(text).VerifyDiagnostics(
// (1,21): error CS1003: Syntax error, ']' expected
// class c { int this[ public void m() { } }
Diagnostic(ErrorCode.ERR_SyntaxError, "public").WithArguments("]", "public").WithLocation(1, 21),
......@@ -6734,7 +6734,7 @@ public void ColonColonInExplicitInterfaceMember()
// _ _::this
Diagnostic(ErrorCode.ERR_RbraceExpected, ""));
CreateCompilationWithMscorlib(text).VerifyDiagnostics(
CreateStandardCompilation(text).VerifyDiagnostics(
// (2,4): error CS1003: Syntax error, '.' expected
// _ _::this
Diagnostic(ErrorCode.ERR_SyntaxError, "::").WithArguments(".", "::").WithLocation(2, 4),
......
......@@ -1574,7 +1574,7 @@ public void Error_IndexerDefinition()
new ErrorDescription { Code = 1514, Line = 1, Column = 17 },
new ErrorDescription { Code = 1513, Line = 1, Column = 17 });
CreateCompilationWithMscorlib(test).VerifyDiagnostics(
CreateStandardCompilation(test).VerifyDiagnostics(
// (1,13): error CS1003: Syntax error, '[' expected
// string this ="";
Diagnostic(ErrorCode.ERR_SyntaxError, "=").WithArguments("[", "=").WithLocation(1, 13),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册