未验证 提交 fef3d37a 编写于 作者: J Julien Couvreur 提交者: GitHub

Use LangVersion 8 in tests rather than Preview (#39421)

上级 7cf994c6
......@@ -267,7 +267,7 @@ static async System.Collections.Generic.IAsyncEnumerable<int> M()
var comp = CreateCompilationWithTasksExtensions(new[] { source }, parseOptions: TestOptions.Regular7_3);
comp.VerifyDiagnostics(expected);
comp = CreateCompilationWithTasksExtensions(new[] { source }, parseOptions: TestOptions.RegularPreview);
comp = CreateCompilationWithTasksExtensions(new[] { source }, parseOptions: TestOptions.Regular8);
comp.VerifyDiagnostics(
// (4,45): error CS0234: The type or namespace name 'IAsyncEnumerable<>' does not exist in the namespace 'System.Collections.Generic' (are you missing an assembly reference?)
// static async System.Collections.Generic.IAsyncEnumerable<int> M()
......@@ -1290,7 +1290,7 @@ async System.Collections.Generic.IAsyncEnumerator<int> M()
var comp = CreateCompilationWithTasksExtensions(new[] { source, AsyncStreamsTypes }, parseOptions: TestOptions.Regular7_3);
comp.VerifyDiagnostics(expected);
comp = CreateCompilationWithTasksExtensions(new[] { source, AsyncStreamsTypes }, parseOptions: TestOptions.RegularPreview);
comp = CreateCompilationWithTasksExtensions(new[] { source, AsyncStreamsTypes }, parseOptions: TestOptions.Regular8);
comp.VerifyDiagnostics();
}
......
......@@ -38,7 +38,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading.
var comp = CreateCompilationWithTasksExtensions(new[] { source, s_IAsyncEnumerable }, parseOptions: TestOptions.Regular7_3);
comp.VerifyDiagnostics(expected);
comp = CreateCompilationWithTasksExtensions(new[] { source, s_IAsyncEnumerable }, parseOptions: TestOptions.RegularPreview);
comp = CreateCompilationWithTasksExtensions(new[] { source, s_IAsyncEnumerable }, parseOptions: TestOptions.Regular8);
comp.VerifyDiagnostics();
}
......
......@@ -991,7 +991,7 @@ void M()
}
}";
var compilation = CreateCompilationWithIndex(source, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
compilation = CreateCompilationWithIndex(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
compilation = CreateCompilationWithIndex(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
}
[Fact]
......@@ -1474,7 +1474,7 @@ void M()
Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7_3, "..").WithArguments("range operator", "8.0").WithLocation(9, 17)
};
CreateCompilationWithIndexAndRange(source, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
CreateCompilationWithIndexAndRange(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
CreateCompilationWithIndexAndRange(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
}
[Fact]
......
......@@ -7598,7 +7598,7 @@ void M(string z)
var c = CreateCompilation(new[] { source });
c.VerifyDiagnostics(expected);
c = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
c = CreateCompilation(source, parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(expected);
expected = new[]
......@@ -65,7 +65,7 @@ static void Main()
};
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular7_3);
comp.VerifyDiagnostics(expected);
comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
comp = CreateCompilation(source, parseOptions: TestOptions.Regular8);
comp.VerifyDiagnostics(
// (7,11): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' context.
// string? s1 = null;
......
......@@ -384,7 +384,7 @@ public static void Main()
Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7_3, "1 switch { _ => 0, }").WithArguments("recursive patterns", "8.0").WithLocation(5, 17)
);
CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
}
[Fact]
......@@ -1093,7 +1093,7 @@ class _ {}
var compilation = CreatePatternCompilation(source);
compilation.VerifyDiagnostics(expected);
compilation = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
compilation = CreateCompilation(source, parseOptions: TestOptions.Regular8);
compilation.VerifyDiagnostics(expected);
expected = new[]
......
......@@ -670,7 +670,7 @@ static void Main()
CreateCompilation(source, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
CreateCompilation(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
CreateCompilation(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
}
[Fact]
......@@ -696,7 +696,7 @@ static async Task Main()
CreateCompilationWithTasksExtensions(new[] { source, IAsyncDisposableDefinition }, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
CreateCompilationWithTasksExtensions(new[] { source, IAsyncDisposableDefinition }, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
CreateCompilationWithTasksExtensions(new[] { source, IAsyncDisposableDefinition }, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
}
[Fact]
......@@ -772,7 +772,7 @@ static void Main()
}
}
";
CreateCompilation(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics(
CreateCompilation(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics(
// (7,15): error CS0106: The modifier 'public' is not valid for this item
// using public readonly var x = (IDisposable)null;
Diagnostic(ErrorCode.ERR_BadMemberFlag, "public").WithArguments("public").WithLocation(7, 15),
......
......@@ -1847,7 +1847,7 @@ public void ParenthesizedExpression_03()
UsingStatement(@"switch (e) { case (x: ((3))): ; }", TestOptions.RegularWithoutRecursivePatterns, expect);
checkNodes();
UsingStatement(@"switch (e) { case (x: ((3))): ; }", TestOptions.RegularPreview);
UsingStatement(@"switch (e) { case (x: ((3))): ; }", TestOptions.Regular8);
checkNodes();
void checkNodes()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册