File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
lib/SILOptimizer/UtilityPasses Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,11 @@ class MapOpaqueArchetypes : public SILCloner<MapOpaqueArchetypes> {
57
57
.getTypeExpansionContext ()
58
58
.shouldLookThroughOpaqueTypeArchetypes ())
59
59
return ty;
60
- // Remap types containing opaque result types in the current context.
61
- return getBuilder ()
62
- . getTypeLowering ( SILType::getPrimitiveObjectType (ty))
63
- . getLoweredType ()
64
- . getASTType ( );
60
+
61
+ return substOpaqueTypesWithUnderlyingTypes (
62
+ ty,
63
+ TypeExpansionContext ( getBuilder (). getFunction ()),
64
+ /* allowLoweredTypes= */ false );
65
65
}
66
66
67
67
ProtocolConformanceRef remapConformance (Type ty,
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -emit-module %s -disable-availability-checking
3
+
4
+ // We substitute away opaque archetypes after serialization;
5
+ // make sure this correctly handles unlowered types like
6
+ // AST functions and packs.
7
+
8
+ public func horse< T> ( _: T ) { }
9
+
10
+ @_transparent public func packCallee< each T > ( _ t: repeat each T ) {
11
+ repeat horse( each t)
12
+ }
13
+
14
+ @inlinable public func packCaller( ) {
15
+ packCallee ( opaque ( ) )
16
+ }
17
+
18
+ public func opaque( ) -> some Any { return 3 }
You can’t perform that action at this time.
0 commit comments