Skip to content

Commit 6029f61

Browse files
committed
[Concurrency] Improve comments based on review feedback.
1 parent 06d322b commit 6029f61

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

include/swift/AST/Decl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5913,7 +5913,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
59135913
/// Retrieve the location of the 'throws' keyword, if present.
59145914
SourceLoc getThrowsLoc() const { return ThrowsLoc; }
59155915

5916-
/// Returns true if the function is async.
5916+
/// Returns true if the function is marked as `async`. The
5917+
/// type of the function will be `async` as well.
59175918
bool hasAsync() const { return Bits.AbstractFunctionDecl.Async; }
59185919

59195920
/// Returns true if the function body throws.

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7425,6 +7425,7 @@ Parser::parseDeclInit(ParseDeclOptions Flags, DeclAttributes &Attributes) {
74257425
}
74267426

74277427
// Initializers cannot be 'async'.
7428+
// FIXME: We should be able to lift this restriction.
74287429
if (asyncLoc.isValid()) {
74297430
diagnose(asyncLoc, diag::async_init)
74307431
.fixItRemove(asyncLoc);

lib/Sema/TypeCheckProtocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ enum class MatchKind : uint8_t {
234234
/// The witness would match if an additional requirement were met.
235235
MissingRequirement,
236236

237-
/// The witness is async, but the requirement does not.
237+
/// The witness and requirement disagree on 'async'.
238238
AsyncConflict,
239239

240240
/// The witness throws, but the requirement does not.

0 commit comments

Comments
 (0)