@@ -134,11 +134,11 @@ class TypePath = M1::TypePath;
134134
135135module TypePath = M1:: TypePath;
136136
137- private module Input2 implements InputSig2< TypeMentionTypeTree > {
138- TypeMentionTypeTree getABaseTypeMention ( Type t ) { none ( ) }
137+ private module Input2 implements InputSig2< TypeMention > {
138+ TypeMention getABaseTypeMention ( Type t ) { none ( ) }
139139
140140 Type getATypeParameterConstraint ( TypeParameter tp , TypePath path ) {
141- exists ( TypeMention tm | result = tm .resolveTypeAt ( path ) |
141+ exists ( TypeMention tm | result = tm .getTypeAt ( path ) |
142142 tm = tp .( TypeParamTypeParameter ) .getTypeParam ( ) .getATypeBound ( ) .getTypeRepr ( ) or
143143 tm = tp .( SelfTypeParameter ) .getTrait ( ) or
144144 tm =
@@ -158,8 +158,7 @@ private module Input2 implements InputSig2<TypeMentionTypeTree> {
158158 * inference module for more information.
159159 */
160160 predicate conditionSatisfiesConstraint (
161- TypeAbstraction abs , TypeMentionTypeTree condition , TypeMentionTypeTree constraint ,
162- boolean transitive
161+ TypeAbstraction abs , TypeMention condition , TypeMention constraint , boolean transitive
163162 ) {
164163 // `impl` blocks implementing traits
165164 transitive = false and
@@ -209,7 +208,7 @@ private module Input2 implements InputSig2<TypeMentionTypeTree> {
209208 }
210209}
211210
212- private module M2 = Make2< TypeMentionTypeTree , Input2 > ;
211+ private module M2 = Make2< TypeMention , Input2 > ;
213212
214213import M2
215214
@@ -228,7 +227,7 @@ module Consistency {
228227 // mention for the self type has multiple types for a path.
229228 not exists ( ImplItemNode impl , TypePath selfTypePath |
230229 n = impl .getAnAssocItem ( ) .( Function ) .getSelfParam ( ) and
231- strictcount ( impl .( Impl ) .getSelfTy ( ) .( TypeMention ) .resolveTypeAt ( selfTypePath ) ) > 1
230+ strictcount ( impl .( Impl ) .getSelfTy ( ) .( TypeMention ) .getTypeAt ( selfTypePath ) ) > 1
232231 )
233232 }
234233}
@@ -294,7 +293,7 @@ private class FunctionDeclaration extends Function {
294293 result = getAssocFunctionTypeAt ( this , i .asSome ( ) , pos , path )
295294 or
296295 i .isNone ( ) and
297- result = this .getParam ( pos .asPosition ( ) ) .getTypeRepr ( ) .( TypeMention ) .resolveTypeAt ( path )
296+ result = this .getParam ( pos .asPosition ( ) ) .getTypeRepr ( ) .( TypeMention ) .getTypeAt ( path )
298297 )
299298 }
300299
@@ -305,7 +304,7 @@ private class FunctionDeclaration extends Function {
305304 getAssocFunctionTypeAt ( this , i .asSome ( ) , any ( FunctionPosition pos | pos .isReturn ( ) ) , path )
306305 or
307306 i .isNone ( ) and
308- result = getReturnTypeMention ( this ) .resolveTypeAt ( path )
307+ result = getReturnTypeMention ( this ) .getTypeAt ( path )
309308 )
310309 }
311310
@@ -349,12 +348,12 @@ private TypeMention getCallExprTypeMentionArgument(CallExpr ce, TypeArgumentPosi
349348
350349pragma [ nomagic]
351350private Type getCallExprTypeArgument ( CallExpr ce , TypeArgumentPosition apos , TypePath path ) {
352- result = getCallExprTypeMentionArgument ( ce , apos ) .resolveTypeAt ( path )
351+ result = getCallExprTypeMentionArgument ( ce , apos ) .getTypeAt ( path )
353352 or
354353 // Handle constructions that use `Self(...)` syntax
355354 exists ( Path p , TypePath path0 |
356355 p = CallExprImpl:: getFunctionPath ( ce ) and
357- result = p .( TypeMention ) .resolveTypeAt ( path0 ) and
356+ result = p .( TypeMention ) .getTypeAt ( path0 ) and
358357 path0 .isCons ( TTypeParamTypeParameter ( apos .asTypeParam ( ) ) , path )
359358 )
360359}
@@ -377,16 +376,16 @@ private TypeMention getTypeAnnotation(AstNode n) {
377376/** Gets the type of `n`, which has an explicit type annotation. */
378377pragma [ nomagic]
379378private Type inferAnnotatedType ( AstNode n , TypePath path ) {
380- result = getTypeAnnotation ( n ) .resolveTypeAt ( path )
379+ result = getTypeAnnotation ( n ) .getTypeAt ( path )
381380 or
382- result = n .( ShorthandSelfParameterMention ) .resolveTypeAt ( path )
381+ result = n .( ShorthandSelfParameterMention ) .getTypeAt ( path )
383382}
384383
385384pragma [ nomagic]
386385private Type inferFunctionBodyType ( AstNode n , TypePath path ) {
387386 exists ( Function f |
388387 n = f .getFunctionBody ( ) and
389- result = getReturnTypeMention ( f ) .resolveTypeAt ( path ) and
388+ result = getReturnTypeMention ( f ) .getTypeAt ( path ) and
390389 not exists ( ImplTraitReturnType i | i .getFunction ( ) = f |
391390 result = i or result = i .getATypeParameter ( )
392391 )
@@ -430,7 +429,7 @@ module CertainTypeInference {
430429 private TypePath getPathToImplSelfTypeParam ( TypeParam tp ) {
431430 exists ( ImplItemNode impl |
432431 tp = impl .getTypeParam ( _) and
433- TTypeParamTypeParameter ( tp ) = impl .( Impl ) .getSelfTy ( ) .( TypeMention ) .resolveTypeAt ( result )
432+ TTypeParamTypeParameter ( tp ) = impl .( Impl ) .getSelfTy ( ) .( TypeMention ) .getTypeAt ( result )
434433 )
435434 }
436435
@@ -446,7 +445,7 @@ module CertainTypeInference {
446445 // and the path `Foo<i64>::bar` we must resolve `A` to `i64`.
447446 exists ( TypePath pathToTp |
448447 pathToTp = getPathToImplSelfTypeParam ( tp ) and
449- result = p .getQualifier ( ) .( TypeMention ) .resolveTypeAt ( pathToTp .appendInverse ( suffix ) )
448+ result = p .getQualifier ( ) .( TypeMention ) .getTypeAt ( pathToTp .appendInverse ( suffix ) )
450449 )
451450 or
452451 // For type parameters of the function we must resolve their
@@ -462,11 +461,11 @@ module CertainTypeInference {
462461 }
463462
464463 private Type inferCertainStructExprType ( StructExpr se , TypePath path ) {
465- result = se .getPath ( ) .( TypeMention ) .resolveTypeAt ( path )
464+ result = se .getPath ( ) .( TypeMention ) .getTypeAt ( path )
466465 }
467466
468467 private Type inferCertainStructPatType ( StructPat sp , TypePath path ) {
469- result = sp .getPath ( ) .( TypeMention ) .resolveTypeAt ( path )
468+ result = sp .getPath ( ) .( TypeMention ) .getTypeAt ( path )
470469 }
471470
472471 predicate certainTypeEquality ( AstNode n1 , TypePath prefix1 , AstNode n2 , TypePath prefix2 ) {
@@ -902,7 +901,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
902901 // type of a field
903902 exists ( TypeMention tp |
904903 tp = this .getField ( dpos .asFieldPos ( ) ) .getTypeRepr ( ) and
905- result = tp .resolveTypeAt ( path )
904+ result = tp .getTypeAt ( path )
906905 )
907906 or
908907 // type parameter of the struct itself
@@ -955,7 +954,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
955954 // Handle constructions that use `Self {...}` syntax
956955 exists ( TypeMention tm , TypePath path0 |
957956 tm = this .getStructPath ( ) and
958- result = tm .resolveTypeAt ( path0 ) and
957+ result = tm .getTypeAt ( path0 ) and
959958 path0 .isCons ( TTypeParamTypeParameter ( apos .asTypeParam ( ) ) , path )
960959 )
961960 }
@@ -1065,7 +1064,7 @@ pragma[nomagic]
10651064private Type getCallExprTypeQualifier ( CallExpr ce , TypePath path ) {
10661065 exists ( TypeMention tm |
10671066 tm = getCallExprPathQualifier ( ce ) and
1068- result = tm .resolveTypeAt ( path ) and
1067+ result = tm .getTypeAt ( path ) and
10691068 not resolvePath ( tm ) instanceof Trait
10701069 )
10711070}
@@ -2327,19 +2326,19 @@ private module MethodResolution {
23272326 * instance of the type being implemented.
23282327 */
23292328 private module TypeQualifierIsInstantiationOfImplSelfInput implements
2330- IsInstantiationOfInputSig< MethodCallCallExpr , TypeMentionTypeTree >
2329+ IsInstantiationOfInputSig< MethodCallCallExpr , TypeMention >
23312330 {
23322331 pragma [ nomagic]
23332332 private predicate potentialInstantiationOf0 (
2334- MethodCallCallExpr ce , ImplItemNode impl , TypeMentionTypeTree constraint
2333+ MethodCallCallExpr ce , ImplItemNode impl , TypeMention constraint
23352334 ) {
23362335 ce .hasTypeQualifiedCandidate ( impl ) and
23372336 constraint = impl .getSelfPath ( )
23382337 }
23392338
23402339 pragma [ nomagic]
23412340 predicate potentialInstantiationOf (
2342- MethodCallCallExpr ce , TypeAbstraction abs , TypeMentionTypeTree constraint
2341+ MethodCallCallExpr ce , TypeAbstraction abs , TypeMention constraint
23432342 ) {
23442343 potentialInstantiationOf0 ( ce , abs , constraint ) and
23452344 if abs .( Impl ) .hasTrait ( )
@@ -2350,14 +2349,13 @@ private module MethodResolution {
23502349 else any ( )
23512350 }
23522351
2353- predicate relevantConstraint ( TypeMentionTypeTree constraint ) {
2352+ predicate relevantConstraint ( TypeMention constraint ) {
23542353 potentialInstantiationOf0 ( _, _, constraint )
23552354 }
23562355 }
23572356
23582357 private module TypeQualifierIsInstantiationOfImplSelf =
2359- IsInstantiationOf< MethodCallCallExpr , TypeMentionTypeTree ,
2360- TypeQualifierIsInstantiationOfImplSelfInput > ;
2358+ IsInstantiationOf< MethodCallCallExpr , TypeMention , TypeQualifierIsInstantiationOfImplSelfInput > ;
23612359
23622360 /**
23632361 * A configuration for anti-matching the type of a receiver against the type of
@@ -2478,7 +2476,7 @@ private module MethodCallMatchingInput implements MatchingWithEnvironmentInputSi
24782476 .getGenericArgList ( )
24792477 .getTypeArg ( apos .asMethodTypeArgumentPosition ( ) )
24802478 .( TypeMention )
2481- .resolveTypeAt ( path )
2479+ .getTypeAt ( path )
24822480 or
24832481 result = getCallExprTypeArgument ( this , apos , path )
24842482 }
@@ -3009,7 +3007,7 @@ abstract private class TupleLikeConstructor extends Addressable {
30093007 }
30103008
30113009 Type getParameterType ( FunctionPosition pos , TypePath path ) {
3012- result = this .getTupleField ( pos .asPosition ( ) ) .getTypeRepr ( ) .( TypeMention ) .resolveTypeAt ( path )
3010+ result = this .getTupleField ( pos .asPosition ( ) ) .getTypeRepr ( ) .( TypeMention ) .getTypeAt ( path )
30133011 }
30143012}
30153013
@@ -3364,7 +3362,7 @@ private module FieldExprMatchingInput implements MatchingInputSig {
33643362 )
33653363 or
33663364 dpos .isField ( ) and
3367- result = this .getTypeRepr ( ) .( TypeMention ) .resolveTypeAt ( path )
3365+ result = this .getTypeRepr ( ) .( TypeMention ) .getTypeAt ( path )
33683366 }
33693367
33703368 override string toString ( ) { result = this .getAstNode ( ) .toString ( ) }
@@ -3716,7 +3714,7 @@ private module StructPatMatchingInput implements MatchingInputSig {
37163714 // The struct/enum type is supplied explicitly as a type qualifier, e.g.
37173715 // `let Foo<Bar>::Variant { ... } = ...`.
37183716 apos .isStructPos ( ) and
3719- result = this .getPath ( ) .( TypeMention ) .resolveTypeAt ( path )
3717+ result = this .getPath ( ) .( TypeMention ) .getTypeAt ( path )
37203718 }
37213719
37223720 Declaration getTarget ( ) { result = resolvePath ( this .getPath ( ) ) }
@@ -3766,7 +3764,7 @@ private module TupleStructPatMatchingInput implements MatchingInputSig {
37663764 // The struct/enum type is supplied explicitly as a type qualifier, e.g.
37673765 // `let Option::<Foo>::Some(x) = ...`.
37683766 apos .isSelf ( ) and
3769- result = this .getPath ( ) .( TypeMention ) .resolveTypeAt ( path )
3767+ result = this .getPath ( ) .( TypeMention ) .getTypeAt ( path )
37703768 }
37713769
37723770 Declaration getTarget ( ) { result = resolvePath ( this .getPath ( ) ) }
@@ -3955,13 +3953,13 @@ private Type inferClosureExprType(AstNode n, TypePath path) {
39553953 or
39563954 // Propagate return type annotation to body
39573955 n = ce .getClosureBody ( ) and
3958- result = ce .getRetType ( ) .getTypeRepr ( ) .( TypeMention ) .resolveTypeAt ( path )
3956+ result = ce .getRetType ( ) .getTypeRepr ( ) .( TypeMention ) .getTypeAt ( path )
39593957 )
39603958}
39613959
39623960pragma [ nomagic]
39633961private Type inferCastExprType ( CastExpr ce , TypePath path ) {
3964- result = ce .getTypeRepr ( ) .( TypeMention ) .resolveTypeAt ( path )
3962+ result = ce .getTypeRepr ( ) .( TypeMention ) .getTypeAt ( path )
39653963}
39663964
39673965cached
@@ -4159,7 +4157,7 @@ private module Debug {
41594157
41604158 predicate debugInferShorthandSelfType ( ShorthandSelfParameterMention self , TypePath path , Type t ) {
41614159 self = getRelevantLocatable ( ) and
4162- t = self .resolveTypeAt ( path )
4160+ t = self .getTypeAt ( path )
41634161 }
41644162
41654163 predicate debugInferMethodCallType ( AstNode n , TypePath path , Type t ) {
@@ -4174,7 +4172,7 @@ private module Debug {
41744172
41754173 predicate debugTypeMention ( TypeMention tm , TypePath path , Type type ) {
41764174 tm = getRelevantLocatable ( ) and
4177- tm .resolveTypeAt ( path ) = type
4175+ tm .getTypeAt ( path ) = type
41784176 }
41794177
41804178 Type debugInferAnnotatedType ( AstNode n , TypePath path ) {
0 commit comments