22// RUN: %target-typecheck-verify-swift -swift-version 4 -enable-testing
33
44private func privateFunction( ) { }
5- // expected-note@-1 4 {{global function 'privateFunction()' is not public}}
5+ // expected-note@-1 2 {{global function 'privateFunction()' is not public}}
66fileprivate func fileprivateFunction( ) { }
7- // expected-note@-1 4 {{global function 'fileprivateFunction()' is not public}}
7+ // expected-note@-1 2 {{global function 'fileprivateFunction()' is not public}}
88func internalFunction( ) { }
9- // expected-note@-1 4 {{global function 'internalFunction()' is not public}}
9+ // expected-note@-1 2 {{global function 'internalFunction()' is not public}}
1010@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}}
1212public func publicFunction( ) { }
1313
1414func internalIntFunction( ) -> Int { }
1515// expected-note@-1 {{global function 'internalIntFunction()' is not public}}
1616
1717private 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}}
1919fileprivate 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}}
2121func 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}}
2323
2424func internalIntFunction2( ) -> Int { }
2525// expected-note@-1 {{global function 'internalIntFunction2()' is not '@usableFromInline' or public}}
@@ -56,11 +56,11 @@ func internalFunctionWithDefaultValue(
5656 versionedFunction ( )
5757 // OK
5858 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}}
6060 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}}
6262 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}}
6464
6565 return 0
6666 } ( ) ,
@@ -77,16 +77,16 @@ public func publicFunctionWithDefaultValue(
7777 publicFunction ( )
7878
7979 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}}
8181
8282 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}}
8484
8585 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}}
8787
8888 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}}
9090
9191 return 0
9292 } ( ) ,
@@ -102,7 +102,7 @@ public func evilCode(
102102 x: Int = {
103103 let _ = publicFunction ( )
104104 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}}
106106
107107 func localFunction( ) {
108108 publicFunction ( )
@@ -122,16 +122,16 @@ public struct HasSubscript {
122122 publicFunction ( )
123123
124124 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}}
126126
127127 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}}
129129
130130 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}}
132132
133133 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}}
135135
136136 return 0
137137 } ( ) ) -> Int {
0 commit comments