2
2
// RUN: %target-typecheck-verify-swift -swift-version 4 -enable-testing
3
3
4
4
private func privateFunction( ) { }
5
- // expected-note@-1 4 {{global function 'privateFunction()' is not public}}
5
+ // expected-note@-1 2 {{global function 'privateFunction()' is not public}}
6
6
fileprivate func fileprivateFunction( ) { }
7
- // expected-note@-1 4 {{global function 'fileprivateFunction()' is not public}}
7
+ // expected-note@-1 2 {{global function 'fileprivateFunction()' is not public}}
8
8
func internalFunction( ) { }
9
- // expected-note@-1 4 {{global function 'internalFunction()' is not public}}
9
+ // expected-note@-1 2 {{global function 'internalFunction()' is not public}}
10
10
@usableFromInline func versionedFunction( ) { }
11
- // expected-note@-1 7 {{global function 'versionedFunction()' is not public}}
11
+ // expected-note@-1 4 {{global function 'versionedFunction()' is not public}}
12
12
public func publicFunction( ) { }
13
13
14
14
func internalIntFunction( ) -> Int { }
15
15
// expected-note@-1 {{global function 'internalIntFunction()' is not public}}
16
16
17
17
private func privateFunction2( ) { }
18
- // expected-note@-1 2 {{global function 'privateFunction2()' is not '@usableFromInline' or public}}
18
+ // expected-note@-1 {{global function 'privateFunction2()' is not '@usableFromInline' or public}}
19
19
fileprivate func fileprivateFunction2( ) { }
20
- // expected-note@-1 2 {{global function 'fileprivateFunction2()' is not '@usableFromInline' or public}}
20
+ // expected-note@-1 {{global function 'fileprivateFunction2()' is not '@usableFromInline' or public}}
21
21
func internalFunction2( ) { }
22
- // expected-note@-1 2 {{global function 'internalFunction2()' is not '@usableFromInline' or public}}
22
+ // expected-note@-1 {{global function 'internalFunction2()' is not '@usableFromInline' or public}}
23
23
24
24
func internalIntFunction2( ) -> Int { }
25
25
// expected-note@-1 {{global function 'internalIntFunction2()' is not '@usableFromInline' or public}}
@@ -56,11 +56,11 @@ func internalFunctionWithDefaultValue(
56
56
versionedFunction ( )
57
57
// OK
58
58
internalFunction2 ( )
59
- // expected-error@-1 2 {{global function 'internalFunction2()' is internal and cannot be referenced from a default argument value}}
59
+ // expected-error@-1 {{global function 'internalFunction2()' is internal and cannot be referenced from a default argument value}}
60
60
fileprivateFunction2 ( )
61
- // expected-error@-1 2 {{global function 'fileprivateFunction2()' is fileprivate and cannot be referenced from a default argument value}}
61
+ // expected-error@-1 {{global function 'fileprivateFunction2()' is fileprivate and cannot be referenced from a default argument value}}
62
62
privateFunction2 ( )
63
- // expected-error@-1 2 {{global function 'privateFunction2()' is private and cannot be referenced from a default argument value}}
63
+ // expected-error@-1 {{global function 'privateFunction2()' is private and cannot be referenced from a default argument value}}
64
64
65
65
return 0
66
66
} ( ) ,
@@ -77,16 +77,16 @@ public func publicFunctionWithDefaultValue(
77
77
publicFunction ( )
78
78
79
79
versionedFunction ( )
80
- // expected-error@-1 2 {{global function 'versionedFunction()' is internal and cannot be referenced from a default argument value}}
80
+ // expected-error@-1 {{global function 'versionedFunction()' is internal and cannot be referenced from a default argument value}}
81
81
82
82
internalFunction ( )
83
- // expected-error@-1 2 {{global function 'internalFunction()' is internal and cannot be referenced from a default argument value}}
83
+ // expected-error@-1 {{global function 'internalFunction()' is internal and cannot be referenced from a default argument value}}
84
84
85
85
fileprivateFunction ( )
86
- // expected-error@-1 2 {{global function 'fileprivateFunction()' is fileprivate and cannot be referenced from a default argument value}}
86
+ // expected-error@-1 {{global function 'fileprivateFunction()' is fileprivate and cannot be referenced from a default argument value}}
87
87
88
88
privateFunction ( )
89
- // expected-error@-1 2 {{global function 'privateFunction()' is private and cannot be referenced from a default argument value}}
89
+ // expected-error@-1 {{global function 'privateFunction()' is private and cannot be referenced from a default argument value}}
90
90
91
91
return 0
92
92
} ( ) ,
@@ -102,7 +102,7 @@ public func evilCode(
102
102
x: Int = {
103
103
let _ = publicFunction ( )
104
104
let _ = versionedFunction ( )
105
- // expected-error@-1 2 {{global function 'versionedFunction()' is internal and cannot be referenced from a default argument value}}
105
+ // expected-error@-1 {{global function 'versionedFunction()' is internal and cannot be referenced from a default argument value}}
106
106
107
107
func localFunction( ) {
108
108
publicFunction ( )
@@ -122,16 +122,16 @@ public struct HasSubscript {
122
122
publicFunction ( )
123
123
124
124
versionedFunction ( )
125
- // expected-error@-1 2 {{global function 'versionedFunction()' is internal and cannot be referenced from a default argument value}}
125
+ // expected-error@-1 {{global function 'versionedFunction()' is internal and cannot be referenced from a default argument value}}
126
126
127
127
internalFunction ( )
128
- // expected-error@-1 2 {{global function 'internalFunction()' is internal and cannot be referenced from a default argument value}}
128
+ // expected-error@-1 {{global function 'internalFunction()' is internal and cannot be referenced from a default argument value}}
129
129
130
130
fileprivateFunction ( )
131
- // expected-error@-1 2 {{global function 'fileprivateFunction()' is fileprivate and cannot be referenced from a default argument value}}
131
+ // expected-error@-1 {{global function 'fileprivateFunction()' is fileprivate and cannot be referenced from a default argument value}}
132
132
133
133
privateFunction ( )
134
- // expected-error@-1 2 {{global function 'privateFunction()' is private and cannot be referenced from a default argument value}}
134
+ // expected-error@-1 {{global function 'privateFunction()' is private and cannot be referenced from a default argument value}}
135
135
136
136
return 0
137
137
} ( ) ) -> Int {
0 commit comments