File tree Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -68,20 +68,7 @@ class SILTypeSubstituter :
6868 if (!typeExpansionContext.shouldLookThroughOpaqueTypeArchetypes ())
6969 return subs;
7070
71- return subs.subst ([&](SubstitutableType *s) -> Type {
72- return substOpaqueTypesWithUnderlyingTypes (s->getCanonicalType (),
73- typeExpansionContext);
74- }, [&](CanType dependentType,
75- Type conformingReplacementType,
76- ProtocolDecl *conformedProtocol) -> ProtocolConformanceRef {
77- return substOpaqueTypesWithUnderlyingTypes (
78- ProtocolConformanceRef::forAbstract (conformingReplacementType,
79- conformedProtocol),
80- conformingReplacementType->getCanonicalType (),
81- typeExpansionContext);
82- },
83- SubstFlags::SubstituteOpaqueArchetypes |
84- SubstFlags::PreservePackExpansionLevel);
71+ return subs.mapIntoTypeExpansionContext (typeExpansionContext);
8572 }
8673
8774 // Substitute a function type.
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-emit-silgen %s
2+
3+ public protocol P { }
4+
5+ extension P {
6+ }
7+
8+ public struct S : P {
9+ public func callAsFunction< V> ( _: ( ) -> V ) { }
10+ }
11+
12+ public func f( ) -> some P {
13+ S ( )
14+ }
15+
16+ public struct G < T: P > : P {
17+ public init ( _: ( ) -> T ) { }
18+ }
19+
20+ S ( ) {
21+ return G { return f ( ) }
22+ }
23+
You can’t perform that action at this time.
0 commit comments