forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjc_direct.swift
49 lines (47 loc) · 2.13 KB
/
objc_direct.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// RUN: %target-typecheck-verify-swift -enable-objc-interop -import-objc-header %S/../Inputs/objc_direct.h
// REQUIRES: objc_interop
class BarSubclass: Bar {
override func directMethod() -> String! {
// expected-error@-1 {{instance method overrides a 'final' instance method}}
// expected-error@-2 {{overriding non-open instance method outside of its defining module}}
""
}
override func directMethod2() -> String! {
// expected-error@-1 {{instance method overrides a 'final' instance method}}
// expected-error@-2 {{overriding non-open instance method outside of its defining module}}
""
}
override static func directClassMethod() -> String! {
// expected-error@-1 {{static method overrides a 'final' class method}}
// expected-error@-2 {{overriding non-open static method outside of its defining module}}
""
}
override static func directClassMethod2() -> String! {
// expected-error@-1 {{static method overrides a 'final' class method}}
// expected-error@-2 {{overriding non-open static method outside of its defining module}}
""
}
override func directProtocolMethod() -> String! {
// expected-error@-1 {{instance method overrides a 'final' instance method}}
// expected-error@-2 {{overriding non-open instance method outside of its defining module}}
""
}
override var directProperty: Int32 {
// expected-error@-1 {{property overrides a 'final' property}}
// expected-error@-2 {{overriding non-open property outside of its defining module}}
get {0}
set(value) {}
}
override var directProperty2: Int32 {
// expected-error@-1 {{property overrides a 'final' property}}
// expected-error@-2 {{overriding non-open property outside of its defining module}}
get {0}
set(value) {}
}
override subscript(index: Int32) -> Int32 {
// expected-error@-1 {{subscript overrides a 'final' subscript}}
// expected-error@-2 {{overriding non-open subscript outside of its defining module}}
get {0}
set(value) {}
}
}