Skip to content

Commit 6ee42ab

Browse files
committed
[ConstraintSystem] Make it explicit that default initialized pattern bindings are not supported
1 parent c87e0e1 commit 6ee42ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Sema/CSGen.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3934,8 +3934,13 @@ bool ConstraintSystem::generateConstraints(
39343934
if (!patternType || patternType->hasError())
39353935
return true;
39363936

3937-
auto init = patternBinding->getInit(index);
3937+
if (!patternBinding->isInitialized(index) &&
3938+
patternBinding->isDefaultInitializable(index) &&
3939+
pattern->hasStorage()) {
3940+
llvm_unreachable("default initialization is unsupported");
3941+
}
39383942

3943+
auto init = patternBinding->getInit(index);
39393944
auto target = init ? SolutionApplicationTarget::forInitialization(
39403945
init, dc, patternType, pattern,
39413946
/*bindPatternVarsOneWay=*/true)

0 commit comments

Comments
 (0)