[IRGen] Always get the CanType of a conformance's contextual type (#14928)

The conformance type's contextual type might not be canonical, such as in the case of substituting a `typealias` type for a generic placeholder, so ensure we get the canonical type for the conformance.
This commit is contained in:
hamishknight
2018-03-02 19:10:42 +00:00
committed by Jordan Rose
parent 2380950fa7
commit 31a2bc7bfc
2 changed files with 10 additions and 1 deletions

View File

@@ -1210,7 +1210,8 @@ public:
ConcreteType(SILWT->getConformance()->getDeclContext()
->mapTypeIntoContext(
SILWT->getConformance()->getType()
->getCanonicalType())),
->getCanonicalType())
->getCanonicalType()),
Conformance(*SILWT->getConformance()),
SILEntries(SILWT->getEntries()),
SILConditionalConformances(SILWT->getConditionalConformances()),

View File

@@ -323,3 +323,11 @@ public func double_concrete_concrete() {
func dynamicCastToP1(_ value: Any) -> P1? {
return value as? P1
}
protocol P4 {}
typealias P4Typealias = P4
protocol P5 {}
struct SR7101<T> {}
extension SR7101 : P5 where T == P4Typealias {}