mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Generalize the @noescape attribute to be a type attribute allowed
in arbitrary places. This fixes a regression caught by SR-770 that would otherwise be introduced by us removing automatic currying syntax, it allows the use of @noescape on typealiases (resolving SR-824), allows @noescape on nested function types (fixing rdar://19997680) and allows @noescape to be used on local variables (fixing rdar://19997577). At this point, @noescape should stop being a decl attribute, but I'll bring that up on swift-evolution.
This commit is contained in:
@@ -46,7 +46,7 @@ TYPE_ATTR(in)
|
||||
TYPE_ATTR(inout)
|
||||
TYPE_ATTR(inout_aliasable)
|
||||
TYPE_ATTR(in_guaranteed)
|
||||
TYPE_ATTR(noescape) // Only valid in sil mode.
|
||||
TYPE_ATTR(noescape)
|
||||
TYPE_ATTR(owned)
|
||||
TYPE_ATTR(unowned_inner_pointer)
|
||||
TYPE_ATTR(guaranteed)
|
||||
|
||||
@@ -2045,7 +2045,8 @@ NOTE(fix_unqualified_access_top_level_multi,none,
|
||||
ERROR(type_of_metatype,none,
|
||||
"'.dynamicType' is not allowed after a type name", ())
|
||||
ERROR(invalid_noescape_use,none,
|
||||
"@noescape parameter %0 may only be called", (Identifier))
|
||||
"@noescape %select{value|parameter}1 %0 may only be called",
|
||||
(Identifier, bool))
|
||||
NOTE(noescape_autoclosure,none,
|
||||
"parameter %0 is implicitly @noescape because it was declared @autoclosure",
|
||||
(Identifier))
|
||||
|
||||
Reference in New Issue
Block a user