@@ -4067,6 +4067,8 @@ ERROR(throwing_interpolation_without_try,none,
40674067 " interpolation can throw but is not marked with 'try'" , ())
40684068ERROR(throwing_call_without_try,none,
40694069 " call can throw but is not marked with 'try'" , ())
4070+ ERROR(throwing_async_let_without_try,none,
4071+ " reading 'async let' can throw but is not marked with 'try'" , ())
40704072NOTE(note_forgot_try,none,
40714073 " did you mean to use 'try'?" , ())
40724074NOTE(note_error_to_optional,none,
@@ -4087,6 +4089,9 @@ ERROR(async_call_without_await,none,
40874089 " call is 'async' but is not marked with 'await'" , ())
40884090ERROR(async_call_without_await_in_autoclosure,none,
40894091 " call is 'async' in an autoclosure argument that is not marked with 'await'" , ())
4092+ ERROR(async_call_without_await_in_async_let,none,
4093+ " call is 'async' in an 'async let' initializer that is not marked "
4094+ " with 'await'" , ())
40904095WARNING(no_async_in_await,none,
40914096 " no calls to 'async' functions occur within 'await' expression" , ())
40924097ERROR(async_call_in_illegal_context,none,
@@ -4098,9 +4103,9 @@ ERROR(await_in_illegal_context,none,
40984103 " %select{<<ERROR>>|a default argument|a property initializer|a global variable initializer|an enum case raw value|a catch pattern|a catch guard expression|a defer body}0" ,
40994104 (unsigned ))
41004105ERROR(async_in_nonasync_function,none,
4101- " %select{'async'|'await'}0 in %select{a function|an autoclosure}1 that "
4102- " does not support concurrency" ,
4103- (bool , bool ))
4106+ " %select{'async'|'await'|'async let'}0 in "
4107+ " %select{a function|an autoclosure}1 that does not support concurrency" ,
4108+ (unsigned , bool ))
41044109NOTE(note_add_async_to_function,none,
41054110 " add 'async' to function %0 to make it asynchronous" , (DeclName))
41064111NOTE(note_add_asynchandler_to_function,none,
@@ -4118,6 +4123,21 @@ NOTE(protocol_witness_async_conflict,none,
41184123ERROR(async_autoclosure_nonasync_function,none,
41194124 " 'async' autoclosure parameter in a non-'async' function" , ())
41204125
4126+ ERROR(async_not_let,none,
4127+ " 'async' can only be used with 'let' declarations" , ())
4128+ ERROR(async_let_not_local,none,
4129+ " 'async let' can only be used on local declarations" , ())
4130+ ERROR(async_let_not_initialized,none,
4131+ " 'async let' binding requires an initializer expression" , ())
4132+ ERROR(async_let_no_variables,none,
4133+ " 'async let' requires at least one named variable" , ())
4134+ ERROR(async_let_without_await,none,
4135+ " reference to async let %0 is not marked with 'await'" , (DeclName))
4136+ ERROR(async_let_in_illegal_context,none,
4137+ " async let %0 cannot be referenced in "
4138+ " %select{<<ERROR>>|a default argument|a property initializer|a global variable initializer|an enum case raw value|a catch pattern|a catch guard expression|a defer body}1" ,
4139+ (DeclName, unsigned ))
4140+
41214141ERROR(asynchandler_non_func,none,
41224142 " '@asyncHandler' can only be applied to functions" ,
41234143 ())
0 commit comments