Skip to content

Commit 2e1264f

Browse files
author
Brian King
committed
Add a compatibily test for swift 3
1 parent 7d8d275 commit 2e1264f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

test/Compatibility/override.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-typecheck-verify-swift -parse-as-library -swift-version 3
2+
3+
class A {
4+
@objc func objcVirtualFunction() { } // expected-note{{overridden declaration is here}}
5+
}
6+
7+
class B : A { }
8+
9+
extension B {
10+
override func objcVirtualFunction() { } // expected-warning{{cannot override a non-dynamic class declaration from an extension}}
11+
}

test/decl/inherit/override.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -parse-as-library
1+
// RUN: %target-typecheck-verify-swift -parse-as-library -swift-version 4
22

33
@objc class ObjCClassA {}
44
@objc class ObjCClassB : ObjCClassA {}

0 commit comments

Comments
 (0)