File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -5832,7 +5832,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
58325832
58335833 // Make sure that our SILFunction only has context generic params if our
58345834 // SILFunctionType is non-polymorphic.
5835- if (F->getGenericEnvironment ()) {
5835+ if (F->getGenericEnvironment () &&
5836+ !F->getGenericEnvironment ()->getGenericSignature ()
5837+ ->areAllParamsConcrete ()) {
58365838 require (FTy->isPolymorphic (),
58375839 " non-generic function definitions cannot have a "
58385840 " generic environment" );
Original file line number Diff line number Diff line change @@ -41,3 +41,13 @@ class Generic<T>: NSObject {
4141class SubGeneric1 < U, V> : Generic < Int > {
4242}
4343
44+
45+ // Ensure that the verifier doesn't reject @objc functions where all of the
46+ // generic parameters have been same-typed to concrete types.
47+ public struct GenericStruct < T> { }
48+
49+ public extension GenericStruct where T == String {
50+ public class Y {
51+ @objc public func f( ) -> String { " hello " }
52+ }
53+ }
You can’t perform that action at this time.
0 commit comments