Skip to content

Commit d5b75fe

Browse files
committed
Runtime: Add GenericRequirementKind::SameShape and stub out cases
1 parent 480a917 commit d5b75fe

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

include/swift/ABI/GenericContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ class TargetGenericRequirementDescriptor {
235235
case GenericRequirementKind::Protocol:
236236
case GenericRequirementKind::SameConformance:
237237
case GenericRequirementKind::SameType:
238+
case GenericRequirementKind::SameShape:
238239
return true;
239240
}
240241

include/swift/ABI/MetadataValues.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,9 @@ enum class GenericRequirementKind : uint8_t {
18901890
/// A "same-conformance" requirement, implied by a same-type or base-class
18911891
/// constraint that binds a parameter with protocol requirements.
18921892
SameConformance = 3,
1893-
/// A layout constraint.
1893+
/// A same-shape requirement between generic parameter packs.
1894+
SameShape = 4,
1895+
/// A layout requirement.
18941896
Layout = 0x1F,
18951897
};
18961898

include/swift/Remote/MetadataReader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,9 @@ class MetadataReader {
12441244
case GenericRequirementKind::Layout:
12451245
return TypeLookupError(
12461246
"Unexpected layout requirement in runtime generic signature");
1247+
case GenericRequirementKind::SameShape:
1248+
return TypeLookupError(
1249+
"Unexpected same-shape requirement in runtime generic signature");
12471250
}
12481251
}
12491252

@@ -2771,6 +2774,9 @@ class MetadataReader {
27712774
}
27722775
break;
27732776
}
2777+
2778+
case GenericRequirementKind::SameShape:
2779+
llvm_unreachable("Implement me");
27742780
}
27752781
}
27762782

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,10 @@ llvm::Optional<TypeLookupError> swift::_checkGenericRequirements(
13871387
// FIXME: Implement this check.
13881388
continue;
13891389
}
1390+
1391+
case GenericRequirementKind::SameShape: {
1392+
llvm_unreachable("Implement me");
1393+
}
13901394
}
13911395

13921396
// Unknown generic requirement kind.

0 commit comments

Comments
 (0)