Skip to content

Commit 5b36a5f

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 aa6df79 commit 5b36a5f

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
@@ -280,14 +280,21 @@ static bool isSendableFunctionType(EitherFunctionType eitherFnTy) {
280280

281281
/// Whether the given function type conforms to Escapable.
282282
static bool isEscapableFunctionType(EitherFunctionType eitherFnTy) {
283-
if (auto silFnTy = eitherFnTy.dyn_cast<const SILFunctionType *>()) {
284-
return !silFnTy->isNoEscape();
285-
}
286-
287-
auto functionType = eitherFnTy.get<const FunctionType *>();
283+
// if (auto silFnTy = eitherFnTy.dyn_cast<const SILFunctionType *>()) {
284+
// return !silFnTy->isNoEscape();
285+
// }
286+
//
287+
// auto functionType = eitherFnTy.get<const FunctionType *>();
288+
//
289+
// // TODO: what about autoclosures?
290+
// return !functionType->isNoEscape();
288291

289-
// TODO: what about autoclosures?
290-
return !functionType->isNoEscape();
292+
// FIXME: unify TypeBase::isNoEscape with TypeBase::isEscapable
293+
// LazyConformanceEmitter::visitDestroyValueInst chokes on these instructions
294+
// destroy_value %2 : $@convention(block) @noescape () -> ()
295+
//
296+
// Wrongly claim that all functions today conform to Escapable for now:
297+
return true;
291298
}
292299

293300
static bool isBitwiseCopyableFunctionType(EitherFunctionType eitherFnTy) {

0 commit comments

Comments
 (0)