Skip to content

Spelling test expr #58577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/expr/closure/closures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class ExplicitSelfRequiredTest {
doStuff {method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{14-14= [self] in }} expected-note{{reference 'self.' explicitly}} {{14-14=self.}}
doVoidStuff {_ = method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self] in }} expected-note{{reference 'self.' explicitly}} {{22-22=self.}}
doVoidStuff {() -> () in _ = method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{18-18= [self]}} expected-note{{reference 'self.' explicitly}} {{34-34=self.}}
// With an empty capture list, insertion should should be suggested without a comma
// With an empty capture list, insertion should be suggested without a comma
doStuff { [] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} expected-note{{reference 'self.' explicitly}} {{21-21=self.}}
doStuff { [ ] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} expected-note{{reference 'self.' explicitly}} {{23-23=self.}}
doStuff { [ /* This space intentionally left blank. */ ] in method() } // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note{{capture 'self' explicitly to enable implicit 'self' in this closure}} {{16-16=self}} expected-note{{reference 'self.' explicitly}} {{65-65=self.}}
Expand Down Expand Up @@ -553,7 +553,7 @@ class SR3186 {
}
}

// Apply the explicit 'self' rule even if it referrs to a capture, if
// Apply the explicit 'self' rule even if it refers to a capture, if
// we're inside a nested closure
class SR14120 {
func operation() {}
Expand Down
2 changes: 1 addition & 1 deletion test/expr/closure/trailing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ let someInt = 0
let intArray = [someInt]
limitXY(someInt, toGamut: intArray) {} // expected-error{{extra trailing closure passed in call}}

// <rdar://problem/23036383> QoI: Invalid trailing closures in stmt-conditions produce lowsy diagnostics
// <rdar://problem/23036383> QoI: Invalid trailing closures in stmt-conditions produce lousy diagnostics
func retBool(x: () -> Int) -> Bool {}
func maybeInt(_: () -> Int) -> Int? {}
func twoClosureArgs(_:()->Void, _:()->Void) -> Bool {}
Expand Down
2 changes: 1 addition & 1 deletion test/expr/expressions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ do {
x = (x,(3,y)).1.1
}

// SR-3439 subscript with pound exprssions.
// SR-3439 subscript with pound expressions.
Sr3439: do {
class B {
init() {}
Expand Down