Skip to content

Commit 4fa2e97

Browse files
committed
RequirementMachine: Don't crash if we cannot desugar a same-shape requirement
1 parent 908c936 commit 4fa2e97

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ static void desugarSameShapeRequirement(
451451
!req.getSecondType()->isParameterPack()) {
452452
errors.push_back(RequirementError::forInvalidShapeRequirement(
453453
req, loc));
454+
return;
454455
}
455456

456457
result.emplace_back(RequirementKind::SameShape,
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// {"signature":"swift::rewriting::performConcreteContraction(llvm::ArrayRef<swift::StructuralRequirement>, llvm::SmallVectorImpl<swift::StructuralRequirement>&, llvm::SmallVectorImpl<swift::rewriting::RequirementError>&, bool)"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s
33
func a < each b, each c where(repeat(each c each b)) : {
44
typealias d<each b> = () func e where d<repeat each b> ==

0 commit comments

Comments
 (0)