Skip to content

Commit b1db631

Browse files
Julien Couvreurjcouv
authored andcommitted
Skip tests and rectify expectation
1 parent 67f61c2 commit b1db631

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/Compilers/CSharp/Test/Symbol/Symbols/Source/NullablePublicAPITests.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,20 +2185,22 @@ void M(object o1, object? o2)
21852185

21862186
var declarations = root.DescendantNodes().OfType<ForEachStatementSyntax>().ToList();
21872187

2188-
assertAnnotation(declarations[0], PublicNullableAnnotation.Annotated);
2189-
assertAnnotation(declarations[1], PublicNullableAnnotation.Annotated);
2190-
assertAnnotation(declarations[2], PublicNullableAnnotation.Annotated);
2191-
assertAnnotation(declarations[3], PublicNullableAnnotation.Annotated);
2188+
assertAnnotation(declarations[0]);
2189+
assertAnnotation(declarations[1]);
2190+
assertAnnotation(declarations[2]);
2191+
assertAnnotation(declarations[3]);
21922192

2193-
void assertAnnotation(ForEachStatementSyntax foreachStatement, PublicNullableAnnotation expectedAnnotation)
2193+
void assertAnnotation(ForEachStatementSyntax foreachStatement)
21942194
{
21952195
var symbol = model.GetDeclaredSymbol(foreachStatement);
2196-
Assert.Equal(expectedAnnotation, symbol.NullableAnnotation);
2197-
Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation);
2196+
Assert.Equal(PublicNullableAnnotation.Annotated, symbol.NullableAnnotation);
2197+
Assert.Equal(PublicNullableAnnotation.Annotated, symbol.Type.NullableAnnotation);
21982198

21992199
var typeInfo = model.GetTypeInfo(foreachStatement.Type);
2200-
Assert.Equal(expectedAnnotation, typeInfo.Nullability.Annotation);
2201-
Assert.Equal(expectedAnnotation, typeInfo.ConvertedNullability.Annotation);
2200+
Assert.Equal(PublicNullableAnnotation.Annotated, typeInfo.Nullability.Annotation);
2201+
Assert.Equal(PublicNullableAnnotation.Annotated, typeInfo.ConvertedNullability.Annotation);
2202+
Assert.Equal(PublicNullableAnnotation.Annotated, typeInfo.Type.NullableAnnotation);
2203+
Assert.Equal(PublicNullableAnnotation.Annotated, typeInfo.ConvertedType.NullableAnnotation);
22022204
}
22032205
}
22042206

src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ class Program
670670
{
671671
void Method(Program? x, Program2 x2)
672672
{
673-
(Program y1, Program2 y2) = (x, x2);
673+
(Program? y1, Program2? y2) = (x, x2);
674674
}
675675
}";
676676
// The type is not intrinsic and not apparent
@@ -895,7 +895,7 @@ void Method(System.Collections.Generic.IEnumerable<Program> x)
895895
await TestInRegularAndScriptAsync(before, after, options: ExplicitTypeExceptWhereApparent());
896896
}
897897

898-
[WpfFact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExplicitType)]
898+
[WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/37491"), Trait(Traits.Feature, Traits.Features.CodeActionsUseExplicitType)]
899899
[WorkItem(40477, "https://github.com/dotnet/roslyn/issues/40477")]
900900
public async Task NotNullableType_ForeachVarDeconstruction()
901901
{
@@ -913,14 +913,13 @@ void Method(System.Collections.Generic.IEnumerable<(Program, Program)> x)
913913
}
914914
}
915915
}";
916-
// UNDONE: should be `foreach ((Program? y1, Program? y2) in x)`
917916
var after = @"
918917
class Program
919918
{
920919
void Method(System.Collections.Generic.IEnumerable<(Program, Program)> x)
921920
{
922921
#nullable enable
923-
foreach ((Program y1, Program y2) in x)
922+
foreach ((Program? y1, Program? y2) in x)
924923
{
925924
}
926925
}

0 commit comments

Comments
 (0)