Skip to content

Commit ac24f18

Browse files
committed
Add some expression examples
1 parent 9072d86 commit ac24f18

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

test/Parse/trailing-comma.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct Foo {
102102

103103
}
104104

105-
func f(in: @differentiable(reverse,) (Int) -> Int) { } // expected-warning {{@differentiable' has been renamed to '@differentiable(reverse)' and will be removed in the next release}} expected-error {{unexpected ',' separator}} expected-error {{expected ',' separator}} expected-error {{unnamed parameters must be written with the empty name '_'}}
105+
func f(in: @differentiable(reverse,) (Int) -> Int) { } // expected-warning {{@differentiable' has been renamed to '@differentiable(reverse)' and will be removed in the next release}} expected-error {{expected ',' separator}} expected-error {{unnamed parameters must be written with the empty name '_'}}
106106

107107
@derivative(of: Self.other,) // expected-error {{unexpected ',' separator}}
108108
func foo() {}
@@ -144,7 +144,7 @@ while true, { } // expected-error {{expected '{' after 'while' condition}}
144144
if #available(OSX 51,) { // expected-error {{expected platform name}}
145145
}
146146

147-
@available(OSX 10.7, iOS 7.0, *,) // expected-error {{expected platform name}}
147+
@available(OSX 10.7, iOS 7.0, *,) // expected-error {{expected platform name}} expected-error {{expected declaration}}
148148
@_originallyDefinedIn(module: "HighLevel", OSX 10.9, iOS 13.0,) // expected-error {{unexpected ',' separator}}
149-
@backDeployed(before: OSX 10.9,) // expected-error {{expected version number in '@backDeployed' attribute}}
149+
@backDeployed(before: OSX 10.9,) // expected-error {{unexpected ',' separator}}
150150
public struct StructWithAvailability {}

test/decl/ext/typealias.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ typealias Bar2<
8888
T2,
8989
Bool,
9090
>
91+
92+
let _ = Foo<Int, Bool, String,>.self
93+
let _ = Bar2<Int, Bool,>()

test/type/types.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ let tupleTypeWithTrailingComma: (
225225
quux: String,
226226
)
227227

228+
let _ = (bar: String, quux: String,).self
229+
228230
let closureTypeWithTrailingCommas: (
229231
String,
230232
String,

0 commit comments

Comments
 (0)