File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,12 @@ void AnalysisInfo::analyze(const SILArgument *selfParam) {
582
582
worklist.pushUsesOfValueIfNotVisited (selfParam);
583
583
584
584
while (Operand *operand = worklist.pop ()) {
585
+ // A type-dependent use of `self` is an instruction that contains the
586
+ // DynamicSelfType. These instructions do not access any protected
587
+ // state.
588
+ if (operand->isTypeDependent ())
589
+ continue ;
590
+
585
591
SILInstruction *user = operand->getUser ();
586
592
587
593
// First, check if this is an apply that involves `self`
Original file line number Diff line number Diff line change @@ -684,8 +684,7 @@ actor OhBrother {
684
684
static var DefaultResult : Int { 10 }
685
685
686
686
init ( ) {
687
- // expected-note@+2 {{after this closure involving 'self', only non-isolated properties of 'self' can be accessed from this init}}
688
- // expected-warning@+1 {{cannot access property 'giver' here in non-isolated initializer; this is an error in the Swift 6 language mode}}
687
+ // this is OK: we're using DynamicSelfType but that doesn't access protected state.
689
688
self . giver = { ( x: OhBrother ) -> Int in Self . DefaultResult }
690
689
}
691
690
You can’t perform that action at this time.
0 commit comments