Skip to content

Commit fef3d37

Browse files
authored
Use LangVersion 8 in tests rather than Preview (#39421)
1 parent 7cf994c commit fef3d37

8 files changed

+13
-13
lines changed

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncIteratorTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static async System.Collections.Generic.IAsyncEnumerable<int> M()
267267
var comp = CreateCompilationWithTasksExtensions(new[] { source }, parseOptions: TestOptions.Regular7_3);
268268
comp.VerifyDiagnostics(expected);
269269

270-
comp = CreateCompilationWithTasksExtensions(new[] { source }, parseOptions: TestOptions.RegularPreview);
270+
comp = CreateCompilationWithTasksExtensions(new[] { source }, parseOptions: TestOptions.Regular8);
271271
comp.VerifyDiagnostics(
272272
// (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?)
273273
// static async System.Collections.Generic.IAsyncEnumerable<int> M()
@@ -1290,7 +1290,7 @@ async System.Collections.Generic.IAsyncEnumerator<int> M()
12901290
var comp = CreateCompilationWithTasksExtensions(new[] { source, AsyncStreamsTypes }, parseOptions: TestOptions.Regular7_3);
12911291
comp.VerifyDiagnostics(expected);
12921292

1293-
comp = CreateCompilationWithTasksExtensions(new[] { source, AsyncStreamsTypes }, parseOptions: TestOptions.RegularPreview);
1293+
comp = CreateCompilationWithTasksExtensions(new[] { source, AsyncStreamsTypes }, parseOptions: TestOptions.Regular8);
12941294
comp.VerifyDiagnostics();
12951295
}
12961296

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAwaitForeachTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading.
3838
var comp = CreateCompilationWithTasksExtensions(new[] { source, s_IAsyncEnumerable }, parseOptions: TestOptions.Regular7_3);
3939
comp.VerifyDiagnostics(expected);
4040

41-
comp = CreateCompilationWithTasksExtensions(new[] { source, s_IAsyncEnumerable }, parseOptions: TestOptions.RegularPreview);
41+
comp = CreateCompilationWithTasksExtensions(new[] { source, s_IAsyncEnumerable }, parseOptions: TestOptions.Regular8);
4242
comp.VerifyDiagnostics();
4343
}
4444

src/Compilers/CSharp/Test/Semantic/Semantics/IndexAndRangeTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ void M()
991991
}
992992
}";
993993
var compilation = CreateCompilationWithIndex(source, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
994-
compilation = CreateCompilationWithIndex(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
994+
compilation = CreateCompilationWithIndex(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
995995
}
996996

997997
[Fact]
@@ -1474,7 +1474,7 @@ void M()
14741474
Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7_3, "..").WithArguments("range operator", "8.0").WithLocation(9, 17)
14751475
};
14761476
CreateCompilationWithIndexAndRange(source, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
1477-
CreateCompilationWithIndexAndRange(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
1477+
CreateCompilationWithIndexAndRange(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
14781478
}
14791479

14801480
[Fact]

src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7598,7 +7598,7 @@ void M(string z)
75987598
var c = CreateCompilation(new[] { source });
75997599
c.VerifyDiagnostics(expected);
76007600

7601-
c = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
7601+
c = CreateCompilation(source, parseOptions: TestOptions.Regular8);
76027602
c.VerifyDiagnostics(expected);
76037603

76047604
expected = new[]

src/Compilers/CSharp/Test/Semantic/Semantics/NullableTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void Main()
6565
};
6666
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular7_3);
6767
comp.VerifyDiagnostics(expected);
68-
comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
68+
comp = CreateCompilation(source, parseOptions: TestOptions.Regular8);
6969
comp.VerifyDiagnostics(
7070
// (7,11): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' context.
7171
// string? s1 = null;

src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests2.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ public static void Main()
384384
Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7_3, "1 switch { _ => 0, }").WithArguments("recursive patterns", "8.0").WithLocation(5, 17)
385385
);
386386

387-
CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
387+
CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
388388
}
389389

390390
[Fact]
@@ -1093,7 +1093,7 @@ class _ {}
10931093
var compilation = CreatePatternCompilation(source);
10941094
compilation.VerifyDiagnostics(expected);
10951095

1096-
compilation = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
1096+
compilation = CreateCompilation(source, parseOptions: TestOptions.Regular8);
10971097
compilation.VerifyDiagnostics(expected);
10981098

10991099
expected = new[]

src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static void Main()
670670

671671
CreateCompilation(source, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
672672

673-
CreateCompilation(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
673+
CreateCompilation(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
674674
}
675675

676676
[Fact]
@@ -696,7 +696,7 @@ static async Task Main()
696696

697697
CreateCompilationWithTasksExtensions(new[] { source, IAsyncDisposableDefinition }, parseOptions: TestOptions.Regular7_3).VerifyDiagnostics(expected);
698698

699-
CreateCompilationWithTasksExtensions(new[] { source, IAsyncDisposableDefinition }, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics();
699+
CreateCompilationWithTasksExtensions(new[] { source, IAsyncDisposableDefinition }, parseOptions: TestOptions.Regular8).VerifyDiagnostics();
700700
}
701701

702702
[Fact]
@@ -772,7 +772,7 @@ static void Main()
772772
}
773773
}
774774
";
775-
CreateCompilation(source, parseOptions: TestOptions.RegularPreview).VerifyDiagnostics(
775+
CreateCompilation(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics(
776776
// (7,15): error CS0106: The modifier 'public' is not valid for this item
777777
// using public readonly var x = (IDisposable)null;
778778
Diagnostic(ErrorCode.ERR_BadMemberFlag, "public").WithArguments("public").WithLocation(7, 15),

src/Compilers/CSharp/Test/Syntax/Parsing/PatternParsingTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ public void ParenthesizedExpression_03()
18471847
UsingStatement(@"switch (e) { case (x: ((3))): ; }", TestOptions.RegularWithoutRecursivePatterns, expect);
18481848
checkNodes();
18491849

1850-
UsingStatement(@"switch (e) { case (x: ((3))): ; }", TestOptions.RegularPreview);
1850+
UsingStatement(@"switch (e) { case (x: ((3))): ; }", TestOptions.Regular8);
18511851
checkNodes();
18521852

18531853
void checkNodes()

0 commit comments

Comments
 (0)