Skip to content

Commit ad26df0

Browse files
authored
Revert "[Sema] Propagate nonisolated attribute from wrapped property to the synthesized projectedValue property (#60421)" (#60462)
This reverts commit 2aa47b8.
1 parent 93387f8 commit ad26df0

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,13 +2682,6 @@ static VarDecl *synthesizePropertyWrapperProjectionVar(
26822682
var->getAttrs().add(
26832683
new (ctx) ProjectedValuePropertyAttr(name, SourceLoc(), SourceRange(),
26842684
/*Implicit=*/true));
2685-
2686-
// If the wrapped property has a nonisolated attribute, propagate it to
2687-
// the synthesized projectedValue as well.
2688-
if (var->getAttrs().getAttribute<NonisolatedAttr>()) {
2689-
property->getAttrs().add(new (ctx) NonisolatedAttr(/*Implicit=*/true));
2690-
}
2691-
26922685
return property;
26932686
}
26942687

test/Concurrency/global_actor_inference.swift

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -457,51 +457,7 @@ func testInferredFromWrapper(x: InferredFromPropertyWrapper) { // expected-note{
457457
_ = x.test() // expected-error{{call to global actor 'SomeGlobalActor'-isolated instance method 'test()' in a synchronous nonisolated context}}
458458
}
459459

460-
// https://github.com/apple/swift/issues/59380
461-
// https://github.com/apple/swift/issues/59494
462460

463-
// Make sure the nonisolated attribute propagates to the synthesized projectedValue
464-
// variable as well.
465-
466-
@propertyWrapper
467-
struct SimplePropertyWrapper {
468-
var wrappedValue: Int { .zero }
469-
var projectedValue: Int { .max }
470-
}
471-
472-
@MainActor
473-
class HasNonIsolatedProperty {
474-
@SimplePropertyWrapper nonisolated var value
475-
476-
deinit {
477-
_ = value
478-
_ = $value // Ok
479-
}
480-
}
481-
482-
@propertyWrapper
483-
struct SimplePropertyWrapper2 {
484-
var wrappedValue: Int
485-
var projectedValue: SimplePropertyWrapper2 { self }
486-
}
487-
488-
@MainActor
489-
class HasNonIsolatedProperty2 {
490-
@SimplePropertyWrapper2 nonisolated var value = 0
491-
nonisolated init() {}
492-
}
493-
494-
let hasNonIsolatedProperty2 = HasNonIsolatedProperty2()
495-
496-
Task { @MainActor in
497-
hasNonIsolatedProperty2.value = 10
498-
_ = hasNonIsolatedProperty2.$value.wrappedValue
499-
}
500-
501-
Task.detached {
502-
hasNonIsolatedProperty2.value = 10
503-
_ = hasNonIsolatedProperty2.$value.wrappedValue // Ok
504-
}
505461

506462
// ----------------------------------------------------------------------
507463
// Unsafe global actors

0 commit comments

Comments
 (0)