You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the protocol itself is isolated, don't do anything.
32
+
extensionCExplicit:Q{
33
+
func g(){}
34
+
}
35
+
36
+
// expected-error@+3{{conformance of 'CNonIsolated' to protocol 'P' crosses into global actor 'SomeGlobalActor'-isolated code and can cause data races}}
37
+
// expected-note@+2{{turn data races into runtime errors with '@preconcurrency'}}
38
+
// expected-note@+1{{isolate this conformance to the global actor 'SomeGlobalActor' with '@SomeGlobalActor'}}{{33-33=@SomeGlobalActor }}
let _:anyP=CExplicit() // expected-error{{global actor 'SomeGlobalActor'-isolated conformance of 'CExplicit' to 'P' cannot be used in nonisolated context}}
// CHECK-NEXT: unconditional_checked_cast [[COPIED]] : $any Base<Int> & P to any Derived & R
303
+
// CHECK-NEXT: unconditional_checked_cast [prohibit_isolated_conformances] [[COPIED]] : $any Base<Int> & P to any Derived & R
304
304
let _ = baseAndP as!(Derived&R)
305
305
306
-
// CHECK: checked_cast_br Derived.Type in %3 : $@thick Derived.Type to any (Derived & R).Type
306
+
// CHECK: checked_cast_br [prohibit_isolated_conformances] Derived.Type in %3 : $@thick Derived.Type to any (Derived & R).Type
307
307
let _ = derivedType as?(Derived&R).Type
308
308
309
-
// CHECK: unconditional_checked_cast %3 : $@thick Derived.Type to any (Derived & R).Type
309
+
// CHECK: unconditional_checked_cast [prohibit_isolated_conformances] %3 : $@thick Derived.Type to any (Derived & R).Type
310
310
let _ = derivedType as!(Derived&R).Type
311
311
312
312
// CHECK: checked_cast_br any (Base<Int> & P).Type in %2 : $@thick any (Base<Int> & P).Type to Derived.Type
@@ -315,10 +315,10 @@ func downcasts(
315
315
// CHECK: unconditional_checked_cast %2 : $@thick any (Base<Int> & P).Type to Derived.Type
316
316
let _ = baseAndPType as!Derived.Type
317
317
318
-
// CHECK: checked_cast_br any (Base<Int> & P).Type in %2 : $@thick any (Base<Int> & P).Type to any (Derived & R).Type
318
+
// CHECK: checked_cast_br [prohibit_isolated_conformances] any (Base<Int> & P).Type in %2 : $@thick any (Base<Int> & P).Type to any (Derived & R).Type
319
319
let _ = baseAndPType as?(Derived&R).Type
320
320
321
-
// CHECK: unconditional_checked_cast %2 : $@thick any (Base<Int> & P).Type to any (Derived & R).Type
321
+
// CHECK: unconditional_checked_cast [prohibit_isolated_conformances] %2 : $@thick any (Base<Int> & P).Type to any (Derived & R).Type
322
322
let _ = baseAndPType as!(Derived&R).Type
323
323
324
324
// CHECK: return
@@ -378,33 +378,33 @@ func archetypeDowncasts<S,
378
378
// CHECK: [[COPY:%.*]] = alloc_stack $S
379
379
// CHECK-NEXT: copy_addr %0 to [init] [[COPY]] : $*S
380
380
// CHECK-NEXT: [[RESULT:%.*]] = alloc_stack $any Base<T> & P
381
-
// CHECK-NEXT: checked_cast_addr_br take_always S in [[COPY]] : $*S to any Base<T> & P in [[RESULT]] : $*any Base<T> & P
381
+
// CHECK-NEXT: checked_cast_addr_br [prohibit_isolated_conformances] take_always S in [[COPY]] : $*S to any Base<T> & P in [[RESULT]] : $*any Base<T> & P
382
382
let _ = s as?(Base<T>&P)
383
383
384
384
// CHECK: [[COPY:%.*]] = alloc_stack $S
385
385
// CHECK-NEXT: copy_addr [[ARG0]] to [init] [[COPY]] : $*S
386
386
// CHECK-NEXT: [[RESULT:%.*]] = alloc_stack $any Base<T> & P
387
-
// CHECK-NEXT: unconditional_checked_cast_addr S in [[COPY]] : $*S to any Base<T> & P in [[RESULT]] : $*any Base<T> & P
387
+
// CHECK-NEXT: unconditional_checked_cast_addr [prohibit_isolated_conformances] S in [[COPY]] : $*S to any Base<T> & P in [[RESULT]] : $*any Base<T> & P
388
388
let _ = s as!(Base<T>&P)
389
389
390
390
// CHECK: [[COPY:%.*]] = alloc_stack $S
391
391
// CHECK-NEXT: copy_addr [[ARG0]] to [init] [[COPY]] : $*S
392
392
// CHECK-NEXT: [[RESULT:%.*]] = alloc_stack $any Base<Int> & P
393
-
// CHECK-NEXT: checked_cast_addr_br take_always S in [[COPY]] : $*S to any Base<Int> & P in [[RESULT]] : $*any Base<Int> & P
393
+
// CHECK-NEXT: checked_cast_addr_br [prohibit_isolated_conformances] take_always S in [[COPY]] : $*S to any Base<Int> & P in [[RESULT]] : $*any Base<Int> & P
394
394
let _ = s as?(Base<Int>&P)
395
395
396
396
// CHECK: [[COPY:%.*]] = alloc_stack $S
397
397
// CHECK-NEXT: copy_addr [[ARG0]] to [init] [[COPY]] : $*S
398
398
// CHECK-NEXT: [[RESULT:%.*]] = alloc_stack $any Base<Int> & P
399
-
// CHECK-NEXT: unconditional_checked_cast_addr S in [[COPY]] : $*S to any Base<Int> & P in [[RESULT]] : $*any Base<Int> & P
399
+
// CHECK-NEXT: unconditional_checked_cast_addr [prohibit_isolated_conformances] S in [[COPY]] : $*S to any Base<Int> & P in [[RESULT]] : $*any Base<Int> & P
0 commit comments