diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 50f5c21451b..aae964e6c66 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -1718,11 +1718,10 @@ class ParameterTypeFlags { None = 0, Variadic = 1 << 0, AutoClosure = 1 << 1, - Escaping = 1 << 2, - OwnershipShift = 3, + OwnershipShift = 2, Ownership = 7 << OwnershipShift, - NumBits = 6 + NumBits = 5 }; OptionSet value; static_assert(NumBits < 8*sizeof(OptionSet), "overflowed"); @@ -1735,10 +1734,9 @@ public: return ParameterTypeFlags(OptionSet(raw)); } - ParameterTypeFlags(bool variadic, bool autoclosure, bool escaping, + ParameterTypeFlags(bool variadic, bool autoclosure, ValueOwnership ownership) : value((variadic ? Variadic : 0) | (autoclosure ? AutoClosure : 0) | - (escaping ? Escaping : 0) | uint8_t(ownership) << OwnershipShift) {} /// Create one from what's present in the parameter type @@ -1749,7 +1747,6 @@ public: bool isNone() const { return !value; } bool isVariadic() const { return value.contains(Variadic); } bool isAutoClosure() const { return value.contains(AutoClosure); } - bool isEscaping() const { return value.contains(Escaping); } bool isInOut() const { return getValueOwnership() == ValueOwnership::InOut; } bool isShared() const { return getValueOwnership() == ValueOwnership::Shared;} bool isOwned() const { return getValueOwnership() == ValueOwnership::Owned; } @@ -1763,11 +1760,6 @@ public: : value - ParameterTypeFlags::Variadic); } - ParameterTypeFlags withEscaping(bool escaping) const { - return ParameterTypeFlags(escaping ? value | ParameterTypeFlags::Escaping - : value - ParameterTypeFlags::Escaping); - } - ParameterTypeFlags withInOut(bool isInout) const { return withValueOwnership(isInout ? ValueOwnership::InOut : ValueOwnership::Default); @@ -1860,7 +1852,6 @@ public: ParameterTypeFlags asParamFlags() const { return ParameterTypeFlags(/*variadic*/ false, /*autoclosure*/ false, - /*escaping*/ false, getValueOwnership()); } @@ -1931,9 +1922,6 @@ public: /// Determine whether this field is an autoclosure parameter closure. bool isAutoClosure() const { return Flags.isAutoClosure(); } - /// Determine whether this field is an escaping parameter closure. - bool isEscaping() const { return Flags.isEscaping(); } - /// Determine whether this field is marked 'inout'. bool isInOut() const { return Flags.isInOut(); } @@ -2724,9 +2712,6 @@ public: /// Whether the parameter is marked '@autoclosure' bool isAutoClosure() const { return Flags.isAutoClosure(); } - /// Whether the parameter is marked '@escaping' - bool isEscaping() const { return Flags.isEscaping(); } - /// Whether the parameter is marked 'inout' bool isInOut() const { return Flags.isInOut(); } @@ -5374,8 +5359,6 @@ inline ParameterTypeFlags ParameterTypeFlags::fromParameterType(Type paramTy, bool isVariadic, bool isAutoClosure, ValueOwnership ownership) { - bool escaping = paramTy->is() && - !paramTy->castTo()->isNoEscape(); // FIXME(Remove InOut): The last caller that needs this is argument // decomposition. Start by enabling the assertion there and fixing up those // callers, then remove this, then remove @@ -5385,7 +5368,7 @@ ParameterTypeFlags::fromParameterType(Type paramTy, bool isVariadic, ownership == ValueOwnership::InOut); ownership = ValueOwnership::InOut; } - return {isVariadic, isAutoClosure, escaping, ownership}; + return {isVariadic, isAutoClosure, ownership}; } inline const Type *BoundGenericType::getTrailingObjectsPointer() const { diff --git a/include/swift/Serialization/ModuleFormat.h b/include/swift/Serialization/ModuleFormat.h index 67782028e1f..7593edeacbf 100644 --- a/include/swift/Serialization/ModuleFormat.h +++ b/include/swift/Serialization/ModuleFormat.h @@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0; /// describe what change you made. The content of this comment isn't important; /// it just ensures a conflict if two people change the module format. /// Don't worry about adhering to the 80-column limit for this line. -const uint16_t SWIFTMODULE_VERSION_MINOR = 484; // SDK-relative dependencies flag +const uint16_t SWIFTMODULE_VERSION_MINOR = 485; // remove @escaping parameter flag using DeclIDField = BCFixed<31>; @@ -765,7 +765,6 @@ namespace decls_block { TypeIDField, // type BCFixed<1>, // vararg? BCFixed<1>, // autoclosure? - BCFixed<1>, // escaping? ValueOwnershipField // inout, shared or owned? >; diff --git a/lib/AST/ASTDemangler.cpp b/lib/AST/ASTDemangler.cpp index 84f81417a51..c0d1c3f3a19 100644 --- a/lib/AST/ASTDemangler.cpp +++ b/lib/AST/ASTDemangler.cpp @@ -361,10 +361,6 @@ Type ASTBuilder::createFunctionType( .withVariadic(flags.isVariadic()) .withAutoClosure(flags.isAutoClosure()); - if (auto *fnType = type->getAs()) - if (!fnType->isNoEscape()) - parameterFlags = parameterFlags.withEscaping(true); - funcParams.push_back(AnyFunctionType::Param(type, label, parameterFlags)); } diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index e589f7d4c56..23a98b47f76 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -3204,7 +3204,6 @@ namespace { void dumpParameterFlags(ParameterTypeFlags paramFlags) { printFlag(paramFlags.isVariadic(), "vararg"); printFlag(paramFlags.isAutoClosure(), "autoclosure"); - printFlag(paramFlags.isEscaping(), "escaping"); switch (paramFlags.getValueOwnership()) { case ValueOwnership::Default: break; case ValueOwnership::Owned: printFlag("owned"); break; diff --git a/lib/AST/ASTMangler.cpp b/lib/AST/ASTMangler.cpp index 74898838880..430429cd67e 100644 --- a/lib/AST/ASTMangler.cpp +++ b/lib/AST/ASTMangler.cpp @@ -1905,11 +1905,9 @@ void ASTMangler::appendTypeList(Type listTy) { return appendOperator("y"); bool firstField = true; for (auto &field : tuple->getElements()) { - // FIXME: We shouldn't put @escaping in non-parameter list tuples - auto flags = field.getParameterFlags().withEscaping(false); - - assert(flags.isNone()); - appendTypeListElement(field.getName(), field.getRawType(), flags); + assert(field.getParameterFlags().isNone()); + appendTypeListElement(field.getName(), field.getRawType(), + ParameterTypeFlags()); appendListSeparator(firstField); } } else { diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index 404ced91e5f..fb035210c04 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -2424,11 +2424,26 @@ static bool isStructOrClassContext(DeclContext *dc) { return isa(nominal) || isa(nominal); } +static bool isEscaping(Type type) { + if (auto *funcType = type->getAs()) { + if (funcType->getExtInfo().getRepresentation() == + FunctionTypeRepresentation::CFunctionPointer) + return false; + + if (funcType->getExtInfo().isNoEscape()) + return false; + + return true; + } + + return false; +} + static void printParameterFlags(ASTPrinter &printer, PrintOptions options, - ParameterTypeFlags flags) { + ParameterTypeFlags flags, bool escaping) { if (!options.excludeAttrKind(TAK_autoclosure) && flags.isAutoClosure()) printer << "@autoclosure "; - if (!options.excludeAttrKind(TAK_escaping) && flags.isEscaping()) + if (!options.excludeAttrKind(TAK_escaping) && escaping) printer << "@escaping "; switch (flags.getValueOwnership()) { @@ -2561,29 +2576,17 @@ void PrintAST::printOneParameter(const ParamDecl *param, TheTypeLoc.setType(BGT->getGenericArgs()[0]); } - // Special case, if we're not going to use the type repr printing, peek - // through the paren types so that we don't print excessive @escapings. - unsigned numParens = 0; - if (!willUseTypeReprPrinting(TheTypeLoc, CurrentType, Options)) { + if (!param->isVariadic() && + !willUseTypeReprPrinting(TheTypeLoc, CurrentType, Options)) { auto type = TheTypeLoc.getType(); - - printParameterFlags(Printer, Options, paramFlags); - while (auto parenTy = dyn_cast(type.getPointer())) { - ++numParens; - type = parenTy->getUnderlyingType(); - } - - TheTypeLoc = TypeLoc::withoutLoc(type); + printParameterFlags(Printer, Options, paramFlags, + isEscaping(type)); } - for (unsigned i = 0; i < numParens; ++i) - Printer << "("; if (param->getAttrs().hasAttribute()) printTypeLocForImplicitlyUnwrappedOptional(TheTypeLoc); else printTypeLoc(TheTypeLoc); - for (unsigned i = 0; i < numParens; ++i) - Printer << ")"; if (param->isVariadic()) Printer << "..."; @@ -3553,7 +3556,7 @@ public: void visitParenType(ParenType *T) { Printer << "("; - printParameterFlags(Printer, Options, T->getParameterFlags()); + printParameterFlags(Printer, Options, T->getParameterFlags(), false); visit(T->getUnderlyingType()->getInOutObjectType()); Printer << ")"; } @@ -3584,7 +3587,7 @@ public: visit(TD.getVarargBaseTy()); Printer << "..."; } else { - printParameterFlags(Printer, Options, TD.getParameterFlags()); + printParameterFlags(Printer, Options, TD.getParameterFlags(), false); visit(EltType); } } @@ -3841,10 +3844,15 @@ public: Printer << ": "; } - printParameterFlags(Printer, Options, Param.getParameterFlags()); - visit(Param.getPlainType()); - if (Param.isVariadic()) + auto type = Param.getPlainType(); + if (Param.isVariadic()) { + visit(type); Printer << "..."; + } else { + printParameterFlags(Printer, Options, Param.getParameterFlags(), + isEscaping(type)); + visit(type); + } } Printer << ")"; diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 44e6b79f7da..18fdf021663 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -2247,7 +2247,7 @@ static Type mapSignatureFunctionType(ASTContext &ctx, Type type, SmallVector newParams; for (const auto ¶m : funcTy->getParams()) { auto newParamType = mapSignatureParamType(ctx, param.getPlainType()); - ParameterTypeFlags newFlags = param.getParameterFlags().withEscaping(false); + ParameterTypeFlags newFlags = param.getParameterFlags(); // For the 'self' of a method, strip off 'inout'. if (isMethod) { diff --git a/lib/SIL/SILFunctionType.cpp b/lib/SIL/SILFunctionType.cpp index 5b22ee93671..648b8bad7ef 100644 --- a/lib/SIL/SILFunctionType.cpp +++ b/lib/SIL/SILFunctionType.cpp @@ -2155,9 +2155,8 @@ static CanType copyOptionalityFromDerivedToBase(TypeConverter &tc, auto baseParams = baseFunc.getParams(); assert(derivedParams.size() == baseParams.size()); for (unsigned i = 0, e = derivedParams.size(); i < e; i++) { - // FIXME: Why are 'escaping' flags set inconsistently? - assert(derivedParams[i].getParameterFlags().withEscaping(false) == - baseParams[i].getParameterFlags().withEscaping(false)); + assert(derivedParams[i].getParameterFlags() == + baseParams[i].getParameterFlags()); params.emplace_back( copyOptionalityFromDerivedToBase( diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index fd4e0e6931c..f658ce7170d 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -4514,11 +4514,11 @@ public: IdentifierID labelID; TypeID typeID; - bool isVariadic, isAutoClosure, isEscaping; + bool isVariadic, isAutoClosure; unsigned rawOwnership; decls_block::FunctionParamLayout::readRecord(scratch, labelID, typeID, isVariadic, isAutoClosure, - isEscaping, rawOwnership); + rawOwnership); auto ownership = getActualValueOwnership((serialization::ValueOwnership)rawOwnership); @@ -4534,7 +4534,7 @@ public: params.emplace_back(paramTy.get(), MF.getIdentifier(labelID), ParameterTypeFlags(isVariadic, isAutoClosure, - isEscaping, *ownership)); + *ownership)); } if (!isGeneric) { diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index 2d56d60b14e..515fc9573b2 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -3953,7 +3953,7 @@ void Serializer::writeType(Type ty) { FunctionParamLayout::emitRecord( Out, ScratchRecord, abbrCode, addDeclBaseNameRef(param.getLabel()), addTypeRef(param.getPlainType()), paramFlags.isVariadic(), - paramFlags.isAutoClosure(), paramFlags.isEscaping(), rawOwnership); + paramFlags.isAutoClosure(), rawOwnership); } break; diff --git a/test/Compatibility/tuple_arguments_4.swift b/test/Compatibility/tuple_arguments_4.swift index 4dbcc115a53..6cf556f8878 100644 --- a/test/Compatibility/tuple_arguments_4.swift +++ b/test/Compatibility/tuple_arguments_4.swift @@ -1408,7 +1408,7 @@ func processArrayOfFunctions(f1: [((Bool, Bool)) -> ()], } f2.forEach { (block: ((Bool, Bool)) -> ()) in - // expected-error@-1 {{cannot convert value of type '(((Bool, Bool)) -> ()) -> ()' to expected argument type '((Bool, Bool) -> ()) -> Void}} + // expected-error@-1 {{cannot convert value of type '(((Bool, Bool)) -> ()) -> ()' to expected argument type '(@escaping (Bool, Bool) -> ()) -> Void}} block(p) block((c, c)) block(c, c) @@ -1691,5 +1691,5 @@ _ = x.map { (_: Void) in return () } // https://bugs.swift.org/browse/SR-9470 do { func f(_: Int...) {} - let _ = [(1, 2, 3)].map(f) // expected-error {{cannot invoke 'map' with an argument list of type '((Int...) -> ())'}} + let _ = [(1, 2, 3)].map(f) // expected-error {{cannot invoke 'map' with an argument list of type '(@escaping (Int...) -> ())'}} } diff --git a/test/Constraints/closures.swift b/test/Constraints/closures.swift index beeb168d29b..1c92bdf0244 100644 --- a/test/Constraints/closures.swift +++ b/test/Constraints/closures.swift @@ -187,7 +187,7 @@ func testMap() { } // "UnresolvedDot" "in wrong phase" assertion from verifier -[].reduce { $0 + $1 } // expected-error {{cannot invoke 'reduce' with an argument list of type '((_, _) -> _)'}} +[].reduce { $0 + $1 } // expected-error {{cannot invoke 'reduce' with an argument list of type '(@escaping (_, _) -> _)'}} diff --git a/test/Constraints/diagnostics.swift b/test/Constraints/diagnostics.swift index 65c50c3dae8..68d21ba09c7 100644 --- a/test/Constraints/diagnostics.swift +++ b/test/Constraints/diagnostics.swift @@ -626,7 +626,7 @@ struct Radar21692808 { init(count: Int, value: Element) {} } func radar21692808() -> Radar21692808 { - return Radar21692808(count: 1) { // expected-error {{cannot invoke initializer for type 'Radar21692808' with an argument list of type '(count: Int, () -> Int)'}} + return Radar21692808(count: 1) { // expected-error {{cannot invoke initializer for type 'Radar21692808' with an argument list of type '(count: Int, @escaping () -> Int)'}} // expected-note @-1 {{expected an argument list of type '(count: Int, value: Element)'}} return 1 } diff --git a/test/Constraints/enum_cases.swift b/test/Constraints/enum_cases.swift index 089cd38d5d3..e88fd561364 100644 --- a/test/Constraints/enum_cases.swift +++ b/test/Constraints/enum_cases.swift @@ -19,17 +19,17 @@ enum G_E { let arr: [String] = [] let _ = arr.map(E.foo) // Ok let _ = arr.map(E.bar) // Ok -let _ = arr.map(E.two) // expected-error {{cannot invoke 'map' with an argument list of type '((Int, Int) -> E)'}} +let _ = arr.map(E.two) // expected-error {{cannot invoke 'map' with an argument list of type '(@escaping (Int, Int) -> E)'}} // expected-note@-1{{expected an argument list of type '((Self.Element) throws -> T)'}} -let _ = arr.map(E.tuple) // expected-error {{cannot invoke 'map' with an argument list of type '(((x: Int, y: Int)) -> E)'}} +let _ = arr.map(E.tuple) // expected-error {{cannot invoke 'map' with an argument list of type '(@escaping ((x: Int, y: Int)) -> E)'}} // expected-note@-1{{expected an argument list of type '((Self.Element) throws -> T)'}} let _ = arr.map(G_E.foo) // Ok let _ = arr.map(G_E.bar) // Ok -let _ = arr.map(G_E.two) // expected-error {{cannot invoke 'map' with an argument list of type '((String, String) -> G_E)'}} +let _ = arr.map(G_E.two) // expected-error {{cannot invoke 'map' with an argument list of type '(@escaping (String, String) -> G_E)'}} // expected-note@-1{{expected an argument list of type '((Self.Element) throws -> T)'}} -let _ = arr.map(G_E.tuple) // expected-error {{cannot invoke 'map' with an argument list of type '(((x: Int, y: Int)) -> G_E)'}} +let _ = arr.map(G_E.tuple) // expected-error {{cannot invoke 'map' with an argument list of type '(@escaping ((x: Int, y: Int)) -> G_E)'}} // expected-note@-1{{expected an argument list of type '((Self.Element) throws -> T)'}} let _ = E.foo("hello") // expected-error {{missing argument label 'bar:' in call}} diff --git a/test/Constraints/tuple_arguments.swift b/test/Constraints/tuple_arguments.swift index b8b520c8f4d..885d5e232e3 100644 --- a/test/Constraints/tuple_arguments.swift +++ b/test/Constraints/tuple_arguments.swift @@ -1411,7 +1411,7 @@ func processArrayOfFunctions(f1: [((Bool, Bool)) -> ()], } f2.forEach { (block: ((Bool, Bool)) -> ()) in - // expected-error@-1 {{cannot convert value of type '(((Bool, Bool)) -> ()) -> ()' to expected argument type '((Bool, Bool) -> ()) -> Void}} + // expected-error@-1 {{cannot convert value of type '(((Bool, Bool)) -> ()) -> ()' to expected argument type '(@escaping (Bool, Bool) -> ()) -> Void}} block(p) block((c, c)) block(c, c) @@ -1693,7 +1693,7 @@ _ = x.map { (_: Void) in return () } // https://bugs.swift.org/browse/SR-9470 do { func f(_: Int...) {} - let _ = [(1, 2, 3)].map(f) // expected-error {{cannot invoke 'map' with an argument list of type '((Int...) -> ())'}} + let _ = [(1, 2, 3)].map(f) // expected-error {{cannot invoke 'map' with an argument list of type '(@escaping (Int...) -> ())'}} } // rdar://problem/48443263 - cannot convert value of type '() -> Void' to expected argument type '(_) -> Void' diff --git a/test/IDE/print_clang_bool_bridging.swift b/test/IDE/print_clang_bool_bridging.swift index 94275390a5e..ed5dd5079c6 100644 --- a/test/IDE/print_clang_bool_bridging.swift +++ b/test/IDE/print_clang_bool_bridging.swift @@ -34,13 +34,13 @@ typealias CBoolBlock = (Bool) -> Bool typealias ObjCBoolBlock = (Bool) -> Bool typealias DarwinBooleanBlock = (Bool) -> Bool -func testCBoolFnToBlock(_: @escaping @convention(c) (Bool) -> Bool) -> (Bool) -> Bool -func testObjCBoolFnToBlock(_: @escaping @convention(c) (ObjCBool) -> ObjCBool) -> (Bool) -> Bool -func testDarwinBooleanFnToBlock(_: @escaping @convention(c) (DarwinBoolean) -> DarwinBoolean) -> (Bool) -> Bool +func testCBoolFnToBlock(_: @convention(c) (Bool) -> Bool) -> (Bool) -> Bool +func testObjCBoolFnToBlock(_: @convention(c) (ObjCBool) -> ObjCBool) -> (Bool) -> Bool +func testDarwinBooleanFnToBlock(_: @convention(c) (DarwinBoolean) -> DarwinBoolean) -> (Bool) -> Bool -func testCBoolFnToBlockTypedef(_: @escaping CBoolFn) -> CBoolBlock -func testObjCBoolFnToBlockTypedef(_: @escaping ObjCBoolFn) -> ObjCBoolBlock -func testDarwinBooleanFnToBlockTypedef(_: @escaping DarwinBooleanFn) -> DarwinBooleanBlock +func testCBoolFnToBlockTypedef(_: CBoolFn) -> CBoolBlock +func testObjCBoolFnToBlockTypedef(_: ObjCBoolFn) -> ObjCBoolBlock +func testDarwinBooleanFnToBlockTypedef(_: DarwinBooleanFn) -> DarwinBooleanBlock typealias CBoolFnToBlockType = (CBoolFn) -> (Bool) -> Bool typealias ObjCBoolFnToBlockType = (ObjCBoolFn) -> (ObjCBool) -> ObjCBool @@ -71,9 +71,9 @@ class Test : NSObject { var propObjCBoolBlock: (Bool) -> Bool var propDarwinBooleanBlock: (Bool) -> Bool - func testCBoolFn(toBlock fp: @escaping @convention(c) (Bool) -> Bool) -> (Bool) -> Bool - func testObjCBoolFn(toBlock fp: @escaping @convention(c) (ObjCBool) -> ObjCBool) -> (Bool) -> Bool - func testDarwinBooleanFn(toBlock fp: @escaping @convention(c) (DarwinBoolean) -> DarwinBoolean) -> (Bool) -> Bool + func testCBoolFn(toBlock fp: @convention(c) (Bool) -> Bool) -> (Bool) -> Bool + func testObjCBoolFn(toBlock fp: @convention(c) (ObjCBool) -> ObjCBool) -> (Bool) -> Bool + func testDarwinBooleanFn(toBlock fp: @convention(c) (DarwinBoolean) -> DarwinBoolean) -> (Bool) -> Bool func produceCBoolBlockTypedef(_ outBlock: AutoreleasingUnsafeMutablePointer<(@convention(block) (Bool) -> Bool)?>) func produceObjCBoolBlockTypedef(_ outBlock: AutoreleasingUnsafeMutablePointer<(@convention(block) (ObjCBool) -> ObjCBool)?>) diff --git a/test/IDE/print_omit_needless_words.swift b/test/IDE/print_omit_needless_words.swift index 2eb1f88152d..4ed84cacdab 100644 --- a/test/IDE/print_omit_needless_words.swift +++ b/test/IDE/print_omit_needless_words.swift @@ -146,7 +146,7 @@ // CHECK-FOUNDATION: func doSomethingElse(with: NSCopying & NSObjectProtocol) // Note: Function type -> "Function". -// CHECK-FOUNDATION: func sort(_: @escaping @convention(c) (Any, Any) -> Int) +// CHECK-FOUNDATION: func sort(_: @convention(c) (Any, Any) -> Int) // Note: Plural: NSArray without type arguments -> "Objects". // CHECK-FOUNDATION: func remove(_: [Any]) diff --git a/test/IDE/range_info_expr.swift b/test/IDE/range_info_expr.swift index 4dae2ad7998..a863a420402 100644 --- a/test/IDE/range_info_expr.swift +++ b/test/IDE/range_info_expr.swift @@ -101,7 +101,7 @@ func testWithoutActuallyEscaping(closure: (Int) -> Void) { // CHECK-MTEE-EXPR-3-NEXT: { escapable in // CHECK-MTEE-EXPR-3-NEXT: _ = escapable // CHECK-MTEE-EXPR-3-NEXT: } -// CHECK-MTEE-EXPR-3-NEXT: ((Int) -> Void) -> ()false +// CHECK-MTEE-EXPR-3-NEXT: (@escaping (Int) -> Void) -> ()false // CHECK-MTEE-EXPR-3-NEXT: swift_ide_test.(file).testWithoutActuallyEscaping(closure:) // CHECK-MTEE-EXPR-3-NEXT: escapablefalse // CHECK-MTEE-EXPR-3-NEXT: escapable(Int) -> Void diff --git a/validation-test/compiler_crashers_2_fixed/0193-sr10256.swift b/validation-test/compiler_crashers_2_fixed/0193-sr10256.swift new file mode 100644 index 00000000000..db442e03c92 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/0193-sr10256.swift @@ -0,0 +1,5 @@ +// RUN: %target-swift-frontend -emit-module-path /dev/null %s + +func foo(_: (T) -> ()) -> T { fatalError() } + +let y = foo { (x: @escaping () -> (), y: Int) in }