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 @@ -4703,9 +4703,11 @@ ActorIsolation ActorIsolationChecker::determineClosureIsolation(
4703
4703
4704
4704
// `nonisolated(nonsending)` inferred from the context makes
4705
4705
// the closure caller isolated.
4706
- if (auto *closureTy = getType (closure)->getAs <FunctionType>()) {
4707
- if (closureTy->getIsolation ().isNonIsolatedCaller ())
4708
- return ActorIsolation::forCallerIsolationInheriting ();
4706
+ if (auto closureTy = getType (closure)) {
4707
+ if (auto *closureFnTy = closureTy->getAs <FunctionType>()) {
4708
+ if (closureFnTy->getIsolation ().isNonIsolatedCaller ())
4709
+ return ActorIsolation::forCallerIsolationInheriting ();
4710
+ }
4709
4711
}
4710
4712
4711
4713
// 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