@@ -985,17 +985,18 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
985985
986986 private module AccessConstraint {
987987 predicate relevantAccessConstraint (
988- Access a , AccessPosition apos , TypePath path , Type constraint
988+ Access a , Declaration target , AccessPosition apos , TypePath path , Type constraint
989989 ) {
990990 exists ( DeclarationPosition dpos |
991991 accessDeclarationPositionMatch ( apos , dpos ) and
992- typeParameterConstraintHasTypeParameter ( a .getTarget ( ) , dpos , path , _, constraint , _, _)
992+ target = a .getTarget ( ) and
993+ typeParameterConstraintHasTypeParameter ( target , dpos , path , _, constraint , _, _)
993994 )
994995 }
995996
996997 private newtype TRelevantAccess =
997- MkRelevantAccess ( Access a , AccessPosition apos , TypePath path ) {
998- relevantAccessConstraint ( a , apos , path , _)
998+ MkRelevantAccess ( Access a , Declaration target , AccessPosition apos , TypePath path ) {
999+ relevantAccessConstraint ( a , target , apos , path , _)
9991000 }
10001001
10011002 /**
@@ -1004,19 +1005,20 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
10041005 */
10051006 private class RelevantAccess extends MkRelevantAccess {
10061007 Access a ;
1008+ Declaration target ;
10071009 AccessPosition apos ;
10081010 TypePath path ;
10091011
1010- RelevantAccess ( ) { this = MkRelevantAccess ( a , apos , path ) }
1012+ RelevantAccess ( ) { this = MkRelevantAccess ( a , target , apos , path ) }
10111013
10121014 Type getTypeAt ( TypePath suffix ) {
1013- a . getInferredType ( apos , path .appendInverse ( suffix ) ) = result
1015+ adjustedAccessType ( a , apos , target , path .appendInverse ( suffix ) , result )
10141016 }
10151017
10161018 /** Holds if this relevant access has the type `type` and should satisfy `constraint`. */
10171019 predicate hasTypeConstraint ( Type type , Type constraint ) {
1018- type = a . getInferredType ( apos , path ) and
1019- relevantAccessConstraint ( a , apos , path , constraint )
1020+ adjustedAccessType ( a , apos , target , path , type ) and
1021+ relevantAccessConstraint ( a , target , apos , path , constraint )
10201022 }
10211023
10221024 string toString ( ) {
@@ -1076,7 +1078,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
10761078 TypeAbstraction abs , TypeMention sub , TypePath path , Type t
10771079 ) {
10781080 exists ( TypeMention constraintMention |
1079- at = MkRelevantAccess ( a , apos , prefix ) and
1081+ at = MkRelevantAccess ( a , _ , apos , prefix ) and
10801082 hasConstraintMention ( at , abs , sub , constraint , constraintMention ) and
10811083 conditionSatisfiesConstraintTypeAt ( abs , sub , constraintMention , path , t )
10821084 )
0 commit comments