mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Split exact-subclass and bindable-to-subclass queries.
In many places, we're interested in whether a type with archetypes *might be* a superclass of another type with the right bindings, particularly in the optimizer. Provide a separate Type::isBindableToSuperclassOf method that performs this check. Use it in the devirtualizer to fix rdar://problem/24993618. Using it might unblock other places where the optimizer is conservative, but we can fix those separately.
This commit is contained in:
@@ -521,7 +521,7 @@ found_inherited:
|
||||
subMap, conformanceMap);
|
||||
}
|
||||
assert((getType()->isEqual(foundInherited->getType()) ||
|
||||
foundInherited->getType()->isSuperclassOf(getType(), nullptr))
|
||||
foundInherited->getType()->isExactSuperclassOf(getType(), nullptr))
|
||||
&& "inherited conformance does not match type");
|
||||
return foundInherited;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user