Skip to content

Commit 1c01c37

Browse files
committed
NCGenerics: back-out @NoEscape being ~Escapable
I thought this would be simple to add a check for this, but it turns out that a more complete refactoring that eliminates `isNoEscape` in favor of `isEscapable` is most likely needed.
1 parent 788b6f8 commit 1c01c37

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

lib/AST/ConformanceLookup.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,21 @@ static bool isSendableFunctionType(EitherFunctionType eitherFnTy) {
274274

275275
/// Whether the given function type conforms to Escapable.
276276
static bool isEscapableFunctionType(EitherFunctionType eitherFnTy) {
277-
if (auto silFnTy = eitherFnTy.dyn_cast<const SILFunctionType *>()) {
278-
return !silFnTy->isNoEscape();
279-
}
280-
281-
auto functionType = eitherFnTy.get<const FunctionType *>();
277+
// if (auto silFnTy = eitherFnTy.dyn_cast<const SILFunctionType *>()) {
278+
// return !silFnTy->isNoEscape();
279+
// }
280+
//
281+
// auto functionType = eitherFnTy.get<const FunctionType *>();
282+
//
283+
// // TODO: what about autoclosures?
284+
// return !functionType->isNoEscape();
282285

283-
// TODO: what about autoclosures?
284-
return !functionType->isNoEscape();
286+
// FIXME: unify TypeBase::isNoEscape with TypeBase::isEscapable
287+
// LazyConformanceEmitter::visitDestroyValueInst chokes on these instructions
288+
// destroy_value %2 : $@convention(block) @noescape () -> ()
289+
//
290+
// Wrongly claim that all functions today conform to Escapable for now:
291+
return true;
285292
}
286293

287294
static bool isBitwiseCopyableFunctionType(EitherFunctionType eitherFnTy) {

0 commit comments

Comments
 (0)