Skip to content

Commit 1d27f5b

Browse files
committed
Serialization: Actually deserialize same-shape requirements
I added a test for this a while ago... but the test wasn't running. Fix the test, and fix the bug.
1 parent be058df commit 1d27f5b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ static Optional<RequirementKind> getActualRequirementKind(uint64_t rawKind) {
862862
return RequirementKind::KIND;
863863

864864
switch (rawKind) {
865+
CASE(SameShape)
865866
CASE(Conformance)
866867
CASE(Superclass)
867868
CASE(SameType)

test/Serialization/Inputs/pack_expansion_type_other.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ public func variadicFunction<each T, each U>(t: repeat each T, u: repeat each U)
44
}
55

66
public struct VariadicType<each T> {
7+
public init() {}
8+
79
public func variadicMethod<each U>(t: repeat each T, u: repeat each U) -> (repeat (each T, each U)) {
8-
// FIXME: return (repeat (each t, each u))
9-
fatalError()
10+
return (repeat (each t, each u))
1011
}
1112
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %S/Inputs/pack_expansion_type_other.swift -emit-module -emit-module-path %t/pack_expansion_type_other.swiftmodule -enable-experimental-feature VariadicGenerics
3+
// RUN: %target-typecheck-verify-swift -I %t -enable-experimental-feature VariadicGenerics
34

45
// Experimental features require an asserts compiler
56
// REQUIRES: asserts
67

78
import pack_expansion_type_other
89

9-
variadicFunction(t: 1, 2, u: "hi", "bye")
10-
11-
VariadicType<Int, String>.variadicMethod(t: 1, 2, u: "hi", "bye")
10+
_ = variadicFunction(t: 1, 2, u: "hi", "bye")
11+
_ = VariadicType().variadicMethod(t: 1, "hi", u: "bye", 3)

0 commit comments

Comments
 (0)