File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -2459,10 +2459,11 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
24592459 PrintOptions QualifiedSILTypeOptions =
24602460 PrintOptions::printQualifiedSILType ();
24612461 QualifiedSILTypeOptions.CurrentModule = WMI->getModule ().getSwiftModule ();
2462- *this << " $" << WMI->getLookupType () << " , " << WMI->getMember () << " : " ;
2462+ auto lookupType = WMI->getLookupType ();
2463+ *this << " $" << lookupType << " , " << WMI->getMember () << " : " ;
24632464 WMI->getMember ().getDecl ()->getInterfaceType ().print (
24642465 PrintState.OS , QualifiedSILTypeOptions);
2465- if (!WMI->getTypeDependentOperands ().empty ()) {
2466+ if (( getLocalArchetypeOf (lookupType) || lookupType-> hasDynamicSelfType ()) && !WMI->getTypeDependentOperands ().empty ()) {
24662467 *this << " , " ;
24672468 *this << getIDAndType (WMI->getTypeDependentOperands ()[0 ].get ());
24682469 }
Original file line number Diff line number Diff line change @@ -4177,7 +4177,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
41774177 " Must have a type dependent operand for the opened archetype" );
41784178 verifyLocalArchetype (AMI, lookupType);
41794179 } else {
4180- require (AMI->getTypeDependentOperands ().empty (),
4180+ require (AMI->getTypeDependentOperands ().empty () || lookupType-> hasLocalArchetype () ,
41814181 " Should not have an operand for the opened existential" );
41824182 }
41834183 if (!isa<ArchetypeType>(lookupType) && !isa<DynamicSelfType>(lookupType)) {
Original file line number Diff line number Diff line change 1+ // RUN: %target-run-simple-swift(-O -Xfrontend -sil-verify-all) | %FileCheck %s
2+
3+ protocol P { }
4+ extension P {
5+ func foo( ) -> some Sequence < Int > {
6+ [ 1 , 2 , 3 ]
7+ }
8+ }
9+
10+ struct B {
11+ let p : P
12+
13+ @inline ( never)
14+ func bar( ) {
15+ for x in p. foo ( ) {
16+ print ( x)
17+ }
18+ }
19+ }
20+
21+
22+ struct S : P {
23+ var x = 0
24+ }
25+
26+
27+ let b = B ( p: S ( ) )
28+
29+ // CHECK: 1
30+ // CHECK-NEXT: 2
31+ // CHECK-NEXT: 3
32+ b. bar ( )
33+
You can’t perform that action at this time.
0 commit comments