Skip to content

Conversation

gregomni
Copy link
Contributor

Resolves SR-6097.

@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test and merge


class C1 {}
class C2 : sr6097 {
unowned let aProperty: C1 // should deduce A == C1 despite 'unowned'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you actually know it's deducing this?

@@ -3991,7 +3991,7 @@ static Type getWitnessTypeForMatching(TypeChecker &tc,
Type model = conformance->getType();
TypeSubstitutionMap substitutions = model->getMemberSubstitutions(witness);
if (substitutions.empty())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the witness is in a generic context? Eg,

class G<T> : SomeProto where T : AnyObject {
  weak var t: T?
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants