File tree Expand file tree Collapse file tree 3 files changed +69
-1
lines changed Expand file tree Collapse file tree 3 files changed +69
-1
lines changed Original file line number Diff line number Diff line change @@ -1353,7 +1353,7 @@ bool SILInstruction::isDeallocatingStack() const {
1353
1353
}
1354
1354
1355
1355
static bool typeOrLayoutInvolvesPack (SILType ty, SILFunction const &F) {
1356
- return ty.hasAnyPack () || ty. isOrContainsPack (F);
1356
+ return ty.isOrContainsPack (F);
1357
1357
}
1358
1358
1359
1359
bool SILInstruction::mayRequirePackMetadata (SILFunction const &F) const {
Original file line number Diff line number Diff line change @@ -2490,6 +2490,7 @@ namespace {
2490
2490
IsTypeExpansionSensitive_t isSensitive) {
2491
2491
RecursiveProperties properties =
2492
2492
getReferenceRecursiveProperties (isSensitive);
2493
+ properties = mergeHasPack (HasPack_t (classType->hasAnyPack ()), properties);
2493
2494
2494
2495
if (C->getLifetimeAnnotation () == LifetimeAnnotation::EagerMove)
2495
2496
properties.setLexical (IsNotLexical);
@@ -2506,6 +2507,7 @@ namespace {
2506
2507
RecursiveProperties properties;
2507
2508
2508
2509
properties = mergeIsTypeExpansionSensitive (isSensitive, properties);
2510
+ properties = mergeHasPack (HasPack_t (structType->hasAnyPack ()), properties);
2509
2511
2510
2512
// Bail out if the struct layout relies on itself.
2511
2513
TypeConverter::LowerAggregateTypeRAII loweringStruct (TC, structType);
@@ -2624,6 +2626,7 @@ namespace {
2624
2626
RecursiveProperties properties;
2625
2627
2626
2628
properties = mergeIsTypeExpansionSensitive (isSensitive, properties);
2629
+ properties = mergeHasPack (HasPack_t (enumType->hasAnyPack ()), properties);
2627
2630
2628
2631
// Bail out if the enum layout relies on itself.
2629
2632
TypeConverter::LowerAggregateTypeRAII loweringEnum (TC, enumType);
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: split-file %s %t
3
+
4
+ // RUN: %target-swift-frontend \
5
+ // RUN: %t/Library.swift \
6
+ // RUN: -emit-module \
7
+ // RUN: -target %target-swift-5.9-abi-triple \
8
+ // RUN: -enable-library-evolution \
9
+ // RUN: -module-name Library \
10
+ // RUN: -emit-module-path %t/Library.swiftmodule
11
+
12
+ // RUN: %target-build-swift \
13
+ // RUN: %t/Downstream.swift \
14
+ // RUN: -c \
15
+ // RUN: -target %target-swift-5.9-abi-triple \
16
+ // RUN: -parse-as-library \
17
+ // RUN: -module-name main \
18
+ // RUN: -lLibrary \
19
+ // RUN: -I %t \
20
+ // RUN: -o %t/Executable.o
21
+
22
+ //--- Library.swift
23
+
24
+ public struct Paq < each T > {
25
+ public var uette : ( repeat each T )
26
+ }
27
+
28
+ public class Loq < each T > {
29
+ }
30
+
31
+ // Enums don't take packs yet.
32
+
33
+ // public enum Orq<each T> {
34
+ // case uette(repeat each T)
35
+ // case uettette(repeat each T, repeat each T)
36
+ // }
37
+
38
+ //--- Downstream.swift
39
+
40
+ import Library
41
+
42
+ struct Sleeve < T> {
43
+ var impl : Paq < T >
44
+ }
45
+
46
+ func bin< Moribund> ( _ s: consuming Sleeve < Moribund > ) {
47
+ }
48
+
49
+ struct Laq < T> {
50
+ var impl : Loq < T >
51
+ var t : T
52
+ }
53
+
54
+ @_silgen_name ( " bun " )
55
+ func bun< T> ( _ l: consuming Laq < T > ) {
56
+ }
57
+
58
+ // Enums don't take packs yet.
59
+
60
+ // struct Etiq<T> {
61
+ // var impl: Orq<T>
62
+ // }
63
+ //
64
+ // func bon<Moribund>(_ i: consuming Etiq<Moribund>) {
65
+ // }
You can’t perform that action at this time.
0 commit comments