File tree 2 files changed +6
-1
lines changed 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 {
103
103
if (auto *instance = actorInstance.dyn_cast <VarDecl *>()) {
104
104
actorType = instance->getTypeInContext ();
105
105
} else if (auto *expr = actorInstance.dyn_cast <Expr *>()) {
106
- actorType = expr->getType ();
106
+ actorType = expr->getType ()-> getRValueType () ;
107
107
}
108
108
109
109
if (actorType) {
Original file line number Diff line number Diff line change @@ -541,6 +541,11 @@ func preciseIsolated(a: isolated MyActor) async {
541
541
}
542
542
}
543
543
544
+ func testLValueIsolated( ) async {
545
+ var a = A ( ) // expected-warning {{variable 'a' was never mutated}}
546
+ await sync ( isolatedTo: a)
547
+ }
548
+
544
549
@MainActor func fromMain( ns: NotSendable ) async -> NotSendable {
545
550
await pass ( value: ns, isolation: MainActor . shared)
546
551
}
You can’t perform that action at this time.
0 commit comments