File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ NominalTypeDecl *ActorIsolation::getActor() const {
103103 if (auto *instance = actorInstance.dyn_cast <VarDecl *>()) {
104104 actorType = instance->getTypeInContext ();
105105 } else if (auto *expr = actorInstance.dyn_cast <Expr *>()) {
106- actorType = expr->getType ();
106+ actorType = expr->getType ()-> getRValueType () ;
107107 }
108108
109109 if (actorType) {
Original file line number Diff line number Diff line change @@ -541,6 +541,11 @@ func preciseIsolated(a: isolated MyActor) async {
541541 }
542542}
543543
544+ func testLValueIsolated( ) async {
545+ var a = A ( ) // expected-warning {{variable 'a' was never mutated}}
546+ await sync ( isolatedTo: a)
547+ }
548+
544549@MainActor func fromMain( ns: NotSendable ) async -> NotSendable {
545550 await pass ( value: ns, isolation: MainActor . shared)
546551}
You can’t perform that action at this time.
0 commit comments