Skip to content

Commit 9f0bf00

Browse files
committed
Sema: Two small fixes for noncopyable generics SIL tests
1 parent af50d7e commit 9f0bf00

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,10 +954,6 @@ InvertibleAnnotationRequest::evaluate(Evaluator &evaluator,
954954
if (!ctx.LangOpts.hasFeature(Feature::NoncopyableGenerics))
955955
return InverseMarking::forInverse(Kind::None);
956956

957-
// FIXME: just never allow lexical-lifetimes to be disabled?
958-
if (!ctx.supportsMoveOnlyTypes())
959-
decl->diagnose(diag::moveOnly_requires_lexical_lifetimes);
960-
961957
/// The invertible protocol being targeted by this annotation request.
962958

963959
std::function<bool(Type)> isTarget = [&](Type t) -> bool {

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)