@@ -985,17 +985,18 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
985
985
986
986
private module AccessConstraint {
987
987
predicate relevantAccessConstraint (
988
- Access a , AccessPosition apos , TypePath path , Type constraint
988
+ Access a , Declaration target , AccessPosition apos , TypePath path , Type constraint
989
989
) {
990
990
exists ( DeclarationPosition dpos |
991
991
accessDeclarationPositionMatch ( apos , dpos ) and
992
- typeParameterConstraintHasTypeParameter ( a .getTarget ( ) , dpos , path , _, constraint , _, _)
992
+ target = a .getTarget ( ) and
993
+ typeParameterConstraintHasTypeParameter ( target , dpos , path , _, constraint , _, _)
993
994
)
994
995
}
995
996
996
997
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 , _)
999
1000
}
1000
1001
1001
1002
/**
@@ -1004,19 +1005,20 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
1004
1005
*/
1005
1006
private class RelevantAccess extends MkRelevantAccess {
1006
1007
Access a ;
1008
+ Declaration target ;
1007
1009
AccessPosition apos ;
1008
1010
TypePath path ;
1009
1011
1010
- RelevantAccess ( ) { this = MkRelevantAccess ( a , apos , path ) }
1012
+ RelevantAccess ( ) { this = MkRelevantAccess ( a , target , apos , path ) }
1011
1013
1012
1014
Type getTypeAt ( TypePath suffix ) {
1013
- a . getInferredType ( apos , path .appendInverse ( suffix ) ) = result
1015
+ adjustedAccessType ( a , apos , target , path .appendInverse ( suffix ) , result )
1014
1016
}
1015
1017
1016
1018
/** Holds if this relevant access has the type `type` and should satisfy `constraint`. */
1017
1019
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 )
1020
1022
}
1021
1023
1022
1024
string toString ( ) {
@@ -1076,7 +1078,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
1076
1078
TypeAbstraction abs , TypeMention sub , TypePath path , Type t
1077
1079
) {
1078
1080
exists ( TypeMention constraintMention |
1079
- at = MkRelevantAccess ( a , apos , prefix ) and
1081
+ at = MkRelevantAccess ( a , _ , apos , prefix ) and
1080
1082
hasConstraintMention ( at , abs , sub , constraint , constraintMention ) and
1081
1083
conditionSatisfiesConstraintTypeAt ( abs , sub , constraintMention , path , t )
1082
1084
)
0 commit comments