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 @@ -6135,7 +6135,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
61356135 // it is in the same module, update the vtable.
61366136 if (auto *baseDecl = dyn_cast<ClassDecl>(base->getDeclContext ())) {
61376137 if (baseDecl->hasKnownSwiftImplementation () &&
6138- !base->isDynamic () &&
6138+ !base->isDynamic () && !isKnownObjC &&
61396139 override ->getDeclContext ()->isExtensionContext ()) {
61406140 // For compatibility, only generate a warning in Swift 3
61416141 TC.diagnose (override , (TC.Context .isSwiftVersion3 ()
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ class A {
99
1010 @objc func f3( ) { } // expected-note{{overridden declaration is here}}
1111 @objc func f4( ) -> ObjCClassA { } // expected-note{{overridden declaration is here}}
12+ @objc var v1 : Int { return 0 } // expected-note{{overridden declaration is here}}
13+ @objc var v2 : Int { return 0 } // expected-note{{overridden declaration is here}}
14+ @objc var v3 : Int = 0 // expected-note{{overridden declaration is here}}
1215
1316 dynamic func f3D( ) { }
1417 dynamic func f4D( ) -> ObjCClassA { }
@@ -30,6 +33,15 @@ extension B {
3033
3134 override func f3( ) { } // expected-error{{cannot override a non-dynamic class declaration from an extension}}
3235 override func f4( ) -> ObjCClassB { } // expected-error{{cannot override a non-dynamic class declaration from an extension}}
36+ override var v1 : Int { return 1 } // expected-error{{cannot override a non-dynamic class declaration from an extension}}
37+ override var v2 : Int { // expected-error{{cannot override a non-dynamic class declaration from an extension}}
38+ get { return 1 }
39+ set { }
40+ }
41+ override var v3 : Int { // expected-error{{cannot override a non-dynamic class declaration from an extension}}
42+ willSet { }
43+ didSet { }
44+ }
3345
3446 override func f3D( ) { }
3547 override func f4D( ) -> ObjCClassB { }
You can’t perform that action at this time.
0 commit comments