@@ -1231,33 +1231,6 @@ public void Method()
12311231 public class class2 { }
12321232 }
12331233 """ ;
1234-
1235- var comp = CreateCompilation ( source ) ;
1236- comp . VerifyDiagnostics ( ) ;
1237-
1238- var tree = comp . SyntaxTrees . Single ( ) ;
1239- var model = comp . GetSemanticModel ( tree ) ;
1240-
1241- // Verify that o1 has the correct type (object?)
1242- var o1 = tree . GetRoot ( ) . DescendantTokens ( ) . First ( t => t . Text == "o1" && t . Parent is VariableDeclaratorSyntax ) . Parent ;
1243- var o1Type = ( ( ILocalSymbol ) model . GetDeclaredSymbol ( ( VariableDeclaratorSyntax ) o1 ) ) . Type ;
1244- Assert . Equal ( "System.Object?" , o1Type . ToTestDisplayString ( includeNonNullable : true ) ) ;
1245- Assert . True ( o1Type . IsReferenceType ) ;
1246- Assert . Equal ( CodeAnalysis . NullableAnnotation . Annotated , o1Type . NullableAnnotation ) ;
1247-
1248- // Verify that c1 has the correct type (class2?)
1249- var c1 = tree . GetRoot ( ) . DescendantTokens ( ) . First ( t => t . Text == "c1" && t . Parent is VariableDeclaratorSyntax ) . Parent ;
1250- var c1Type = ( ( ILocalSymbol ) model . GetDeclaredSymbol ( ( VariableDeclaratorSyntax ) c1 ) ) . Type ;
1251- Assert . Equal ( "InterlockedExchangeNullProblem.class2?" , c1Type . ToTestDisplayString ( includeNonNullable : true ) ) ;
1252- Assert . True ( c1Type . IsReferenceType ) ;
1253- Assert . Equal ( CodeAnalysis . NullableAnnotation . Annotated , c1Type . NullableAnnotation ) ;
1254-
1255- // Verify that c2 has the correct type (class2?)
1256- var c2 = tree . GetRoot ( ) . DescendantTokens ( ) . First ( t => t . Text == "c2" && t . Parent is VariableDeclaratorSyntax ) . Parent ;
1257- var c2Type = ( ( ILocalSymbol ) model . GetDeclaredSymbol ( ( VariableDeclaratorSyntax ) c2 ) ) . Type ;
1258- Assert . Equal ( "InterlockedExchangeNullProblem.class2?" , c2Type . ToTestDisplayString ( includeNonNullable : true ) ) ;
1259- Assert . True ( c2Type . IsReferenceType ) ;
1260- Assert . Equal ( CodeAnalysis . NullableAnnotation . Annotated , c2Type . NullableAnnotation ) ;
12611234 }
12621235 }
12631236}
0 commit comments