@@ -1375,7 +1375,8 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
13751375 exists ( TypeArgumentPosition tapos , TypeParameterPosition tppos |
13761376 result = a .getTypeArgument ( tapos , path ) and
13771377 tp = target .getTypeParameter ( tppos ) and
1378- typeArgumentParameterPositionMatch ( tapos , tppos )
1378+ typeArgumentParameterPositionMatch ( tapos , tppos ) and
1379+ not result instanceof UnknownType //and path.isEmpty())
13791380 )
13801381 }
13811382
@@ -2355,14 +2356,14 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
23552356 module Make3< InputSig3 Input3> {
23562357 private import Input3
23572358
2359+ /** Gets the type of `n`, which has an explicit type annotation. */
2360+ pragma [ nomagic]
2361+ private Type inferAnnotatedType ( AstNode n , TypePath path ) {
2362+ result = getTypeAnnotation ( n ) .getTypeAt ( path )
2363+ }
2364+
23582365 /** Provides logic for inferring certain type information. */
23592366 private module Certain {
2360- /** Gets the type of `n`, which has an explicit type annotation. */
2361- pragma [ nomagic]
2362- Type inferAnnotatedType ( AstNode n , TypePath path ) {
2363- result = getTypeAnnotation ( n ) .getTypeAt ( path )
2364- }
2365-
23662367 private predicate stepSymmetricCertain (
23672368 AstNode n1 , TypePath path1 , AstNode n2 , TypePath path2
23682369 ) {
@@ -2412,16 +2413,19 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
24122413 /** Gets the inferred certain type of `n` at `path`. */
24132414 cached
24142415 Type inferTypeCertain ( AstNode n , TypePath path ) {
2415- CachedStage:: ref ( ) and
2416- result = inferAnnotatedType ( n , path )
2417- or
2418- result = inferTypeFromStepCertain ( n , path )
2419- or
2420- result = inferTypeCertainSpecific ( n , path )
2421- or
2422- result = inferLogicalOperationType ( n , path )
2423- or
2424- infersCertainTypeAt ( n , path , result .getATypeParameter ( ) )
2416+ (
2417+ CachedStage:: ref ( ) and
2418+ result = inferAnnotatedType ( n , path )
2419+ or
2420+ result = inferTypeFromStepCertain ( n , path )
2421+ or
2422+ result = inferTypeCertainSpecific ( n , path )
2423+ or
2424+ result = inferLogicalOperationType ( n , path )
2425+ or
2426+ infersCertainTypeAt ( n , path , result .getATypeParameter ( ) )
2427+ ) and
2428+ not result instanceof UnknownType
24252429 }
24262430
24272431 /**
@@ -2556,6 +2560,8 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
25562560 not Certain:: certainTypeConflict ( n , prefix , path , result )
25572561 ) and
25582562 (
2563+ result = inferAnnotatedType ( n , path )
2564+ or
25592565 result = inferTypeFromStep ( n , path )
25602566 or
25612567 result = TopDownTyping< inferTypeFromLubStepTopDown / 2 > :: inferType ( n , path )
0 commit comments