We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6142c3c + 3f6b6e8 commit dfa1fe5Copy full SHA for dfa1fe5
lib/Sema/CSGen.cpp
@@ -1301,7 +1301,7 @@ namespace {
1301
ctx.Id_Regex.str());
1302
return Type();
1303
}
1304
- SmallVector<TupleTypeElt, 4> matchElements {ctx.getSubstringType()};
+ SmallVector<TupleTypeElt, 4> matchElements;
1305
if (decodeRegexCaptureTypes(ctx,
1306
E->getSerializedCaptureStructure(),
1307
/*atomType*/ ctx.getSubstringType(),
@@ -1310,6 +1310,7 @@ namespace {
1310
diag::regex_capture_types_failed_to_decode);
1311
1312
1313
+ assert(!matchElements.empty() && "Should have decoded at least an atom");
1314
if (matchElements.size() == 1)
1315
return BoundGenericStructType::get(
1316
regexDecl, Type(), matchElements.front().getType());
0 commit comments