@@ -1441,9 +1441,12 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
14411441 Access a , AccessEnvironment e , Declaration target , TypePath path , Type t , TypeParameter tp
14421442 ) {
14431443 exists ( AccessPosition apos , TypePath pathToTp |
1444- argRootTypeSatisfiesTargetTypeCand ( _, a , e , target , apos , tp , pathToTp ) and
1445- SatisfiesParameterConstraint:: satisfiesConstraint ( MkRelevantAccess ( a , apos , e ) ,
1446- MkRelevantTarget ( target , apos ) , pathToTp .appendInverse ( path ) , t )
1444+ argRootTypeSatisfiesTargetTypeCand ( _, a , e , target , pragma [ only_bind_into ] ( apos ) , tp ,
1445+ pathToTp ) and
1446+ SatisfiesParameterConstraint:: satisfiesConstraint ( MkRelevantAccess ( a ,
1447+ pragma [ only_bind_into ] ( apos ) , e ) ,
1448+ MkRelevantTarget ( target , pragma [ only_bind_into ] ( apos ) ) , pathToTp .appendInverse ( path ) ,
1449+ t )
14471450 )
14481451 }
14491452 }
@@ -1559,8 +1562,12 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
15591562 private predicate typeParameterHasConstraint (
15601563 Declaration target , TypeParameter constrainedTp , TypeMention constraint
15611564 ) {
1562- constrainedTp = target .getTypeParameter ( _) and
1563- constraint = getATypeParameterConstraint ( constrainedTp , target )
1565+ constraint = getATypeParameterConstraint ( constrainedTp , target ) and
1566+ (
1567+ constrainedTp = target .getDeclaredType ( _, _)
1568+ or
1569+ constrainedTp = target .getTypeParameter ( _)
1570+ )
15641571 }
15651572
15661573 /**
@@ -1587,7 +1594,6 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
15871594 TypeParameter tp
15881595 ) {
15891596 typeParameterHasConstraint ( target , constrainedTp , constraint ) and
1590- tp = target .getTypeParameter ( _) and
15911597 tp = constraint .getTypeAt ( pathToTp ) and
15921598 constrainedTp != tp
15931599 }
@@ -2085,9 +2091,9 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
20852091 /**
20862092 * Gets the type parameter at position `pos` of this element, if any.
20872093 *
2088- * TODO:
2089- * This should include type parameters declared on the element itself,
2090- * as well as type parameters declared on the enclosing declaration(s) .
2094+ * This should only include type parameters declared directly on the element
2095+ * itself; any type parameters that are in scope from the declaring element
2096+ * are handled via `getDeclaringType` .
20912097 */
20922098 TypeParameter getTypeParameter ( int pos ) ;
20932099
@@ -2645,7 +2651,6 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
26452651 exists ( Parameterizable target , TypeParameter tp |
26462652 target = invocation .( InvocationMatchingGetTypeArgumentInput:: Access ) .getTarget ( ) and
26472653 parameterizableReturnContextTypedAt ( target , path , tp ) and
2648- tp = target .getTypeParameter ( _) and
26492654 // check that no explicit type arguments have been supplied which bind `tp`
26502655 not exists ( TypeParameter supplied |
26512656 tp = getAConstrained * ( supplied ) and
0 commit comments