File tree Expand file tree Collapse file tree
tests/Pure.DI.IntegrationTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,12 +20,17 @@ public bool IsAccessible(ISymbol symbol) =>
2020 {
2121 var typeInfo = semanticModel . GetTypeInfo ( node , cancellationToken ) ;
2222 var typeSymbol = typeInfo . Type ?? typeInfo . ConvertedType ;
23- if ( typeSymbol is T symbol and not IErrorTypeSymbol )
23+ if ( typeSymbol is not T symbol )
2424 {
25- return ( T ) symbol . WithNullableAnnotation ( NullableAnnotation . NotAnnotated ) ;
25+ return default ;
2626 }
2727
28- return default ;
28+ if ( symbol is IErrorTypeSymbol )
29+ {
30+ throw HandledException . Shared ;
31+ }
32+
33+ return ( T ) symbol . WithNullableAnnotation ( NullableAnnotation . NotAnnotated ) ;
2934 }
3035
3136 public T GetTypeSymbol < T > ( SemanticModel semanticModel , SyntaxNode node )
Original file line number Diff line number Diff line change @@ -2421,11 +2421,10 @@ public static void Main()
24212421 }
24222422 }
24232423 }
2424- """ . RunAsync ( new Options ( LanguageVersion . CSharp9 ) ) ;
2424+ """ . RunAsync ( new Options ( LanguageVersion . CSharp9 , CheckCompilationErrors : false ) ) ;
24252425
24262426 // Then
24272427 result . Success . ShouldBeFalse ( result ) ;
2428- result . Logs . Count ( i => i . Id == LogId . ErrorTypeCannotBeInferred && i . Locations . FirstOrDefault ( ) . GetSource ( ) == "repo" ) . ShouldBe ( 1 , result ) ;
24292428 }
24302429
24312430 [ Theory ]
You can’t perform that action at this time.
0 commit comments