You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AST: Try harder to preserve type sugar in AbstractGenericSignatureRequest
AbstractGenericSignatureRequest tries to minimize the number of GSBs that we
spin up by only creating a GSB if the generic parameter and requirement types
are canonical. If they're not canonical, it first canonicalizes them, then
kicks off a request to compute the canonical signature, and finally, re-applies
type sugar.
We would do this by building a mapping for re-sugaring generic parameters,
however this mapping was only populated for the newly-added generic parameters.
If some of the newly-added generic requirements mention the base signature's
generic parameters, they would remain canonicalized.
Fixes <rdar://problem/67579220>.
Copy file name to clipboardExpand all lines: test/attr/attr_override.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -587,7 +587,7 @@ class SR_4206_Base_7<T> {
587
587
}
588
588
589
589
classSR_4206_Derived_7<T>:SR_4206_Base_7<T>{
590
-
overridefunc foo1()where T:SR_4206_Protocol_2{} // expected-error {{overridden method 'foo1' has generic signature <T where T : SR_4206_Protocol_2> which is incompatible with base method's generic signature <T where T : SR_4206_Protocol_1>; expected generic signature to be <T where τ_0_0 : SR_4206_Protocol_1>}}
590
+
overridefunc foo1()where T:SR_4206_Protocol_2{} // expected-error {{overridden method 'foo1' has generic signature <T where T : SR_4206_Protocol_2> which is incompatible with base method's generic signature <T where T : SR_4206_Protocol_1>; expected generic signature to be <T where T : SR_4206_Protocol_1>}}
591
591
592
592
overridefunc foo2(){} // OK
593
593
}
@@ -624,7 +624,7 @@ class SR_4206_Base_10<T> {
624
624
func foo()where T:SR_4206_Protocol_1{} // expected-note {{overridden declaration is here}}
625
625
}
626
626
classSR_4206_Derived_10<T, U>:SR_4206_Base_10<T>{
627
-
overridefunc foo()where U:SR_4206_Protocol_1{} // expected-error {{overridden method 'foo' has generic signature <T, U where U : SR_4206_Protocol_1> which is incompatible with base method's generic signature <T where T : SR_4206_Protocol_1>; expected generic signature to be <T, U where τ_0_0 : SR_4206_Protocol_1>}}
627
+
overridefunc foo()where U:SR_4206_Protocol_1{} // expected-error {{overridden method 'foo' has generic signature <T, U where U : SR_4206_Protocol_1> which is incompatible with base method's generic signature <T where T : SR_4206_Protocol_1>; expected generic signature to be <T, U where T : SR_4206_Protocol_1>}}
0 commit comments