mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Look through ActorIsolationErasureExpr when finding function DeclRefs for rethrows checking.
This conversion has no effect on `rethrows` checking and should be ignored. Resolves: rdar://142562250
This commit is contained in:
@@ -468,6 +468,10 @@ public:
|
||||
// Look through optional evaluations.
|
||||
} else if (auto optionalEval = dyn_cast<OptionalEvaluationExpr>(fn)) {
|
||||
fn = optionalEval->getSubExpr()->getValueProvidingExpr();
|
||||
// Look through actor isolation erasures.
|
||||
} else if (auto actorIsolationErasure =
|
||||
dyn_cast<ActorIsolationErasureExpr>(fn)) {
|
||||
fn = actorIsolationErasure->getSubExpr()->getValueProvidingExpr();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
20
test/Concurrency/dynamic_actor_isolation.swift
Normal file
20
test/Concurrency/dynamic_actor_isolation.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
// RUN: %target-typecheck-verify-swift -swift-version 5 -strict-concurrency=complete -enable-upcoming-feature DynamicActorIsolation -verify-additional-prefix swift6-
|
||||
// RUN: %target-typecheck-verify-swift -swift-version 6 -verify-additional-prefix swift6-
|
||||
|
||||
// REQUIRES: swift_feature_DynamicActorIsolation
|
||||
|
||||
// Tests related to DynamicActorIsolation feature
|
||||
|
||||
// rdar://142562250 - error: call can throw, but it is not marked with ‘try’ and the error is not handled
|
||||
@MainActor
|
||||
struct TestNoErrorsAboutThrows {
|
||||
struct Column {
|
||||
@MainActor
|
||||
init?(_ column: Int) {}
|
||||
}
|
||||
|
||||
func test(columns: [Int]) {
|
||||
// MainActor isolation erasure shouldn't interfere with effects checking
|
||||
_ = columns.compactMap(Column.init) // Ok
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user