Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ class DerefImplItemNode extends ImplItemNode {
Type resolveSelfTypeAt(TypePath path) { result = resolveImplSelfTypeAt(this, path) }

/**
* Holds if the target type of the dereference implemention mentions a type
* parameter at `path`.
* Holds if the target type of the dereference implementation mentions type
* parameter `tp` at `path`.
*/
pragma[nomagic]
predicate targetHasTypeParameterAt(TypePath path) {
this.getAssocItem("Target").(TypeAlias).getTypeRepr().(TypeMention).getTypeAt(path) instanceof
TypeParameter
predicate targetHasTypeParameterAt(TypePath path, TypeParameter tp) {
tp = this.getAssocItem("Target").(TypeAlias).getTypeRepr().(TypeMention).getTypeAt(path)
}

/** Gets the first type parameter of the type being implemented, if any. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ private Type inferMethodCallTypeSelf(
not result instanceof TypeParameter
or
exists(TypePath pathToTypeParam, TypePath suffix |
impl.targetHasTypeParameterAt(pathToTypeParam) and
impl.targetHasTypeParameterAt(pathToTypeParam, selfParamType) and
path0 = pathToTypeParam.appendInverse(suffix) and
result = t0 and
path = selfPath.append(suffix)
Expand Down