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> {
5832
5832
5833
5833
// Make sure that our SILFunction only has context generic params if our
5834
5834
// SILFunctionType is non-polymorphic.
5835
- if (F->getGenericEnvironment ()) {
5835
+ if (F->getGenericEnvironment () &&
5836
+ !F->getGenericEnvironment ()->getGenericSignature ()
5837
+ ->areAllParamsConcrete ()) {
5836
5838
require (FTy->isPolymorphic (),
5837
5839
" non-generic function definitions cannot have a "
5838
5840
" generic environment" );
Original file line number Diff line number Diff line change @@ -41,3 +41,13 @@ class Generic<T>: NSObject {
41
41
class SubGeneric1 < U, V> : Generic < Int > {
42
42
}
43
43
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