File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
test/SourceKit/CodeComplete Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -4700,9 +4700,11 @@ ActorIsolation ActorIsolationChecker::determineClosureIsolation(
4700
4700
4701
4701
// `nonisolated(nonsending)` inferred from the context makes
4702
4702
// the closure caller isolated.
4703
- if (auto *closureTy = getType (closure)->getAs <FunctionType>()) {
4704
- if (closureTy->getIsolation ().isNonIsolatedCaller ())
4705
- return ActorIsolation::forCallerIsolationInheriting ();
4703
+ if (auto closureTy = getType (closure)) {
4704
+ if (auto *closureFnTy = closureTy->getAs <FunctionType>()) {
4705
+ if (closureFnTy->getIsolation ().isNonIsolatedCaller ())
4706
+ return ActorIsolation::forCallerIsolationInheriting ();
4707
+ }
4706
4708
}
4707
4709
4708
4710
// If a closure has an isolated parameter, it is isolated to that
Original file line number Diff line number Diff line change
1
+ // https://github.com/swiftlang/swift/issues/80985
2
+ struct S < T> {
3
+ func foo< U> ( _ fn: ( T ) -> U ) -> S < U > { fatalError ( ) }
4
+ }
5
+
6
+ func foo( xs: S < ( Int , Int ) > ) {
7
+ _ = {
8
+ let y = xs
9
+ . foo { $1 }
10
+ . foo { $0 }
11
+ // RUN: %sourcekitd-test -req=complete -pos=%(line-1):11 %s -- %s
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments