@@ -134,7 +134,7 @@ class TypePath = M1::TypePath;
134134
135135module TypePath = M1:: TypePath;
136136
137- private module Input2 implements InputSig2 {
137+ private module Input2 implements InputSig2< PreTypeMention > {
138138 private import TypeMention as TM
139139
140140 class TypeMention = TM:: TypeMention ;
@@ -162,7 +162,7 @@ private module Input2 implements InputSig2 {
162162 * inference module for more information.
163163 */
164164 predicate conditionSatisfiesConstraint (
165- TypeAbstraction abs , TypeMention condition , TypeMention constraint , boolean transitive
165+ TypeAbstraction abs , PreTypeMention condition , PreTypeMention constraint , boolean transitive
166166 ) {
167167 // `impl` blocks implementing traits
168168 transitive = false and
@@ -212,7 +212,7 @@ private module Input2 implements InputSig2 {
212212 }
213213}
214214
215- private module M2 = Make2< Input2 > ;
215+ private module M2 = Make2< PreTypeMention , Input2 > ;
216216
217217import M2
218218
@@ -236,6 +236,27 @@ module Consistency {
236236 }
237237}
238238
239+ signature predicate relevantTraitSig ( AstNode n , Trait t ) ;
240+
241+ module TermSatisfiesTrait< relevantTraitSig / 2 relevantTrait> {
242+ private class RelevantTerm extends AstNode {
243+ RelevantTerm ( ) { relevantTrait ( this , _) }
244+
245+ Type getTypeAt ( TypePath path ) { result = inferType ( this , path ) }
246+ }
247+
248+ private module MethodCallSatisfiesDerefConstraintInput implements
249+ SatisfiesConstraintInputSig< RelevantTerm >
250+ {
251+ pragma [ nomagic]
252+ predicate relevantConstraint ( RelevantTerm term , Type constraint ) {
253+ relevantTrait ( term , constraint .( TraitType ) .getTrait ( ) )
254+ }
255+
256+ predicate useUniversalConditions ( ) { none ( ) }
257+ }
258+ }
259+
239260/** A function without a `self` parameter. */
240261private class NonMethodFunction extends Function {
241262 NonMethodFunction ( ) { not this .hasSelfParam ( ) }
@@ -382,7 +403,7 @@ pragma[nomagic]
382403private Type inferAnnotatedType ( AstNode n , TypePath path ) {
383404 result = getTypeAnnotation ( n ) .resolveTypeAt ( path )
384405 or
385- result = n .( ShorthandSelfParameterMention ) .resolveTypeAt ( path )
406+ result = n .( SelfParam ) . ( TypeMention ) .resolveTypeAt ( path )
386407}
387408
388409pragma [ nomagic]
@@ -3770,12 +3791,12 @@ private module ForIterableSatisfiesConstraintInput implements
37703791
37713792pragma [ nomagic]
37723793private AssociatedTypeTypeParameter getIteratorItemTypeParameter ( ) {
3773- result . getTypeAlias ( ) = any ( IteratorTrait t ) .getItemType ( )
3794+ result = getAssociatedTypeTypeParameter ( any ( IteratorTrait t ) .getItemType ( ) )
37743795}
37753796
37763797pragma [ nomagic]
37773798private AssociatedTypeTypeParameter getIntoIteratorItemTypeParameter ( ) {
3778- result . getTypeAlias ( ) = any ( IntoIteratorTrait t ) .getItemType ( )
3799+ result = getAssociatedTypeTypeParameter ( any ( IntoIteratorTrait t ) .getItemType ( ) )
37793800}
37803801
37813802pragma [ nomagic]
@@ -4121,9 +4142,9 @@ private module Debug {
41214142 Input2:: conditionSatisfiesConstraint ( abs , condition , constraint , transitive )
41224143 }
41234144
4124- predicate debugInferShorthandSelfType ( ShorthandSelfParameterMention self , TypePath path , Type t ) {
4145+ predicate debugInferShorthandSelfType ( SelfParam self , TypePath path , Type t ) {
41254146 self = getRelevantLocatable ( ) and
4126- t = self .resolveTypeAt ( path )
4147+ t = self .( TypeMention ) . resolveTypeAt ( path )
41274148 }
41284149
41294150 predicate debugInferMethodCallType ( AstNode n , TypePath path , Type t ) {
0 commit comments