Skip to content

Commit c5291e7

Browse files
committed
NCGenerics: hack to skip requirement check for Optional in SIL mode
1 parent 3a45393 commit c5291e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,14 @@ Type TypeResolution::applyUnboundGenericArguments(
10831083
if (didDiagnoseMoveOnlyGenericArgs(ctx, loc, resultType, genericArgs, dc))
10841084
return ErrorType::get(ctx);
10851085

1086+
if (options.contains(TypeResolutionFlags::SILType)) {
1087+
if (auto nominal = dyn_cast<NominalTypeDecl>(decl)) {
1088+
if (nominal->isOptionalDecl()) {
1089+
skipRequirementsCheck = true;
1090+
}
1091+
}
1092+
}
1093+
10861094
// Get the substitutions for outer generic parameters from the parent
10871095
// type.
10881096
if (parentTy) {

0 commit comments

Comments
 (0)