Skip to content

Spelling parse #42469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
97af3fe
spelling: appear
jsoref Apr 17, 2022
cfc3fa9
spelling: availability
jsoref Apr 17, 2022
651a6b5
spelling: available
jsoref Apr 17, 2022
90d92b2
spelling: coerce
jsoref Apr 17, 2022
d991a5e
spelling: collection
jsoref Apr 17, 2022
7c74dd4
spelling: condition
jsoref Apr 17, 2022
968bd2e
spelling: conditional
jsoref Apr 17, 2022
98b0fee
spelling: delimiter
jsoref Apr 17, 2022
7aba3bc
spelling: derived
jsoref Apr 17, 2022
1fb4cfe
spelling: diagnostics
jsoref Apr 17, 2022
45da99e
spelling: disambiguation
jsoref Apr 17, 2022
0327788
spelling: dropped
jsoref Apr 17, 2022
e6b9eb3
spelling: escaped
jsoref Apr 17, 2022
4e1b67a
spelling: existence
jsoref Apr 17, 2022
488ccd9
spelling: expression
jsoref Apr 17, 2022
18fdd3f
spelling: expressions
jsoref Apr 17, 2022
c9e4b7b
spelling: extended
jsoref Apr 17, 2022
275ee45
spelling: furthermore
jsoref Apr 17, 2022
b74b15b
spelling: identifier
jsoref Apr 17, 2022
07da945
spelling: indentation
jsoref Apr 17, 2022
d6bec75
spelling: inspect
jsoref Apr 17, 2022
5835b0a
spelling: miscellaneous
jsoref Apr 17, 2022
3817c48
spelling: multiline
jsoref Apr 17, 2022
d47099a
spelling: offset
jsoref Apr 17, 2022
3c82a70
spelling: passthrough
jsoref Apr 17, 2022
5d285cc
spelling: precede
jsoref Apr 17, 2022
82be1ab
spelling: prefix
jsoref Apr 18, 2022
5069cd2
spelling: receiver
jsoref Apr 17, 2022
6466e90
spelling: reference
jsoref Apr 17, 2022
ad4f080
spelling: registered
jsoref Apr 17, 2022
bda9f18
spelling: representing
jsoref Apr 17, 2022
39fd7ed
spelling: returned
jsoref Apr 17, 2022
73caad1
spelling: sequence
jsoref Apr 17, 2022
28b8d6c
spelling: should
jsoref Apr 17, 2022
ad7f584
spelling: successfully
jsoref Apr 17, 2022
ff74c6a
spelling: that
jsoref Apr 17, 2022
45a6af9
spelling: the
jsoref Apr 17, 2022
2036b69
spelling: trivia
jsoref Apr 17, 2022
7bf7978
spelling: unsupported
jsoref Apr 17, 2022
f5862f8
spelling: whitespace
jsoref Apr 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/swift/Parse/CodeCompletionCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class CodeCompletionCallbacks {
/// by user.
virtual void completePostfixExprBeginning(CodeCompletionExpr *E) {};

/// Complete the beginning of expr-postfix in a for-each loop sequqence
/// Complete the beginning of expr-postfix in a for-each loop sequence
/// -- no tokens provided by user.
virtual void completeForEachSequenceBeginning(CodeCompletionExpr *E) {};

Expand Down Expand Up @@ -212,7 +212,7 @@ class CodeCompletionCallbacks {

/// Complete a yield statement. A missing yield index means that the
/// completion immediately follows the 'yield' keyword; it may be either
/// an expresion or a parenthesized expression list. A present yield
/// an expression or a parenthesized expression list. A present yield
/// index means that the completion is within the parentheses and is
/// for a specific yield value.
virtual void completeYieldStmt(CodeCompletionExpr *E,
Expand Down
6 changes: 3 additions & 3 deletions include/swift/Parse/Lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Lexer {
}

/// Lex a token. If \c TriviaRetentionMode is \c WithTrivia, passed pointers
/// to trivias are populated.
/// to trivia are populated.
void lex(Token &Result, StringRef &LeadingTriviaResult,
StringRef &TrailingTriviaResult) {
Result = NextToken;
Expand Down Expand Up @@ -423,7 +423,7 @@ class Lexer {
/// source location.
///
/// If \c ExtraIndentation is not null, it will be set to an appropriate
/// additional intendation for adding code in a smaller scope "within" \c Loc.
/// additional indentation for adding code in a smaller scope "within" \c Loc.
static StringRef getIndentationForLine(SourceManager &SM, SourceLoc Loc,
StringRef *ExtraIndentation = nullptr);

Expand Down Expand Up @@ -661,7 +661,7 @@ class Lexer {
/// A lexer that can lex trivia into its pieces
class TriviaLexer {
public:
/// Decompose the triva in \p TriviaStr into their pieces.
/// Decompose the trivia in \p TriviaStr into their pieces.
static ParsedTrivia lexTrivia(StringRef TriviaStr);
};

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Parse/ParsedRawSyntaxNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class ParsedRawSyntaxNode {
/// must be interpreted by the \c SyntaxParseAction, which likely also needs
/// the node type (layout or token) to interpret the data.
/// The data opaque data returned by this function *must not* be used to
/// record the node, only to insepect it.
/// record the node, only to inspect it.
OpaqueSyntaxNode getUnsafeDeferredOpaqueData() const {
assert(isDeferredLayout() || isDeferredToken());
return Data.getOpaque();
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Parse/ParsedRawSyntaxRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class ParsedRawSyntaxRecorder final {
/*IsMissing=*/false, range);
}

/// Record a raw syntax collecton without eny elements. \p loc can be invalid
/// Record a raw syntax collection without eny elements. \p loc can be invalid
/// or an approximate location of where an element of the collection would be
/// if not missing.
ParsedRawSyntaxNode recordEmptyRawSyntaxCollection(syntax::SyntaxKind kind,
Expand Down
8 changes: 4 additions & 4 deletions include/swift/Parse/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class Parser {
savedConsumer(receiver, this) {}
void receive(const Token &tok) override { delayedTokens.push_back(tok); }
Optional<std::vector<Token>> finalize() override {
llvm_unreachable("Cannot finalize a DelayedTokenReciever");
llvm_unreachable("Cannot finalize a DelayedTokenReceiver");
}
~DelayedTokenReceiver() {
if (!shouldTransfer)
Expand Down Expand Up @@ -901,7 +901,7 @@ class Parser {
/// When encountering an error or a missing matching token (e.g. '}'), return
/// the location to use for it. This value should be at the last token in
/// the ASTNode being parsed so that it nests within any enclosing nodes, and,
/// for ASTScope lookups, it does not preceed any identifiers to be looked up.
/// for ASTScope lookups, it does not precede any identifiers to be looked up.
/// However, the latter case does not hold when parsing an interpolated
/// string literal because there may be identifiers to be looked up in the
/// literal and their locations will not precede the location of a missing
Expand Down Expand Up @@ -1704,7 +1704,7 @@ class Parser {
/// \param inLoc The location of the 'in' keyword, if present.
///
/// \returns ParserStatus error if an error occurred. Success if no signature
/// is present or succssfully parsed.
/// is present or successfully parsed.
ParserStatus parseClosureSignatureIfPresent(
DeclAttributes &attributes,
SourceRange &bracketRange,
Expand Down Expand Up @@ -1982,7 +1982,7 @@ DeclName formDeclName(ASTContext &ctx,
bool isInitializer,
bool isSubscript = false);

/// Form a Swift declaration name referemce from its constituent parts.
/// Form a Swift declaration name reference from its constituent parts.
DeclNameRef formDeclNameRef(ASTContext &ctx,
StringRef baseName,
ArrayRef<StringRef> argumentLabels,
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Parse/ParserResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ParserStatus {
}

/// Return true if either 1) no errors were encountered while parsing this,
/// or 2) there were errors but the the parser already recovered from them.
/// or 2) there were errors but the parser already recovered from them.
bool isSuccess() const { return !isError(); }
bool isErrorOrHasCompletion() const { return IsError || IsCodeCompletion; }

Expand Down
4 changes: 2 additions & 2 deletions include/swift/Parse/SyntaxParseActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ class SyntaxParseActions {
/// retrieved using \c getDeferredChildRange if element ranges should be
/// verified
/// \p node is the parent node for which the child at position \p ChildIndex
/// should be retrieved. Furthmore, \p node starts at \p StartLoc.
/// should be retrieved. Furthermore, \p node starts at \p StartLoc.
virtual DeferredNodeInfo getDeferredChild(OpaqueSyntaxNode node,
size_t childIndex) const = 0;

/// To verify \c ParsedRawSyntaxNode element ranges, the range of child nodes
/// returend by \c getDeferredChild needs to be determined. That's what this
/// returned by \c getDeferredChild needs to be determined. That's what this
/// method does.
/// It assumes that \p node is a deferred layout node starting at \p startLoc
/// and returns the range of the child node at \p childIndex.
Expand Down
8 changes: 4 additions & 4 deletions include/swift/Parse/SyntaxParsingContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ class alignas(1 << SyntaxAlignInBits) SyntaxParsingContext {
/// Indicates what action should be performed on the destruction of
/// SyntaxParsingContext
enum class AccumulationMode {
// Coerece the result to one of ContextKind.
// E.g. for ContextKind::Expr, passthroug if the result is CallExpr, whereas
// Coerce the result to one of ContextKind.
// E.g. for ContextKind::Expr, passthrough if the result is CallExpr, whereas
// <UnknownExpr><SomeDecl /></UnknownDecl> for non Exprs.
CoerceKind,

Expand Down Expand Up @@ -154,7 +154,7 @@ class alignas(1 << SyntaxAlignInBits) SyntaxParsingContext {

RootContextData *RootData;

// Offet for 'Storage' this context owns from.
// Offset for 'Storage' this context owns from.
const size_t Offset;

// Operation on destruction.
Expand Down Expand Up @@ -304,7 +304,7 @@ class alignas(1 << SyntaxAlignInBits) SyntaxParsingContext {
/// collection kind. If there're no nodes that can fit into the collection kind,
/// this function does nothing. Otherwise, it creates a collection node in place
/// to contain all sequential suitable nodes from back.
void collectNodesInPlace(SyntaxKind ColletionKind,
void collectNodesInPlace(SyntaxKind CollectionKind,
SyntaxNodeCreationKind nodeCreateK = SyntaxNodeCreationKind::Recorded);

/// On destruction, construct a specified kind of syntax node consuming the
Expand Down
8 changes: 4 additions & 4 deletions lib/Parse/Lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void Lexer::initialize(unsigned Offset, unsigned EndOffset) {
// Check for Unicode BOM at start of file (Only UTF-8 BOM supported now).
size_t BOMLength = contents.startswith("\xEF\xBB\xBF") ? 3 : 0;

// Keep information about existance of UTF-8 BOM for transparency source code
// Keep information about existence of UTF-8 BOM for transparency source code
// editing with libSyntax.
ContentStart = BufferStart + BOMLength;

Expand Down Expand Up @@ -1359,7 +1359,7 @@ unsigned Lexer::lexCharacter(const char *&CurPtr, char StopQuote,
case '"':
case '\'':
if (CurPtr[-1] == StopQuote) {
// Mutliline and custom escaping are only enabled for " quote.
// Multiline and custom escaping are only enabled for " quote.
if (LLVM_UNLIKELY(StopQuote != '"'))
return ~0U;
if (!IsMultilineString && !CustomDelimiterLen)
Expand Down Expand Up @@ -1908,7 +1908,7 @@ void Lexer::lexStringLiteral(unsigned CustomDelimiterLen) {

if (QuoteChar == '\'') {
assert(!IsMultilineString && CustomDelimiterLen == 0 &&
"Single quoted string cannot have custom delimitor, nor multiline");
"Single quoted string cannot have custom delimiter, nor multiline");
diagnoseSingleQuoteStringLiteral(TokStart, CurPtr);
}

Expand Down Expand Up @@ -2722,7 +2722,7 @@ StringRef Lexer::lexTrivia(bool IsForTrailingTrivia,
goto Restart;
case '/':
if (IsForTrailingTrivia || isKeepingComments()) {
// Don't lex comments as trailing trivias (for now).
// Don't lex comments as trailing trivia (for now).
// Don't try to lex comments here if we are lexing comments as Tokens.
break;
} else if (*CurPtr == '/') {
Expand Down
6 changes: 3 additions & 3 deletions lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ void Parser::parseAllAvailabilityMacroArguments() {
// The sub-parser is not actually parsing the source file but the LangOpts
// AvailabilityMacros. No point creating a libSyntax tree for it. In fact, the
// creation of a libSyntax tree would always fail because the
// AvailibilityMacro is not valid Swift source code.
// AvailabilityMacro is not valid Swift source code.
LangOpts.BuildSyntaxTree = false;

for (StringRef macro: LangOpts.AvailabilityMacros) {
Expand Down Expand Up @@ -2921,7 +2921,7 @@ bool Parser::parseNewDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc,
StringRef message;
if (consumeIf(tok::l_paren)) {
if (!Tok.is(tok::identifier)) {
llvm_unreachable("Flag must start with an indentifier");
llvm_unreachable("Flag must start with an identifier");
}

StringRef flag = Tok.getText();
Expand Down Expand Up @@ -6343,7 +6343,7 @@ static bool parseAccessorIntroducer(Parser &P,
/// \endverbatim
///
/// While only 'get' accessors currently support such specifiers,
/// this routine will also diagnose unspported effects specifiers on
/// this routine will also diagnose unsupported effects specifiers on
/// other accessors.
///
/// \param accessors the accessors we've parsed already.
Expand Down
10 changes: 5 additions & 5 deletions lib/Parse/ParseExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ParserResult<Expr> Parser::parseExprArrow() {
ParserResult<Expr> Parser::parseExprSequence(Diag<> Message,
bool isExprBasic,
bool isForConditionalDirective) {
SyntaxParsingContext ExprSequnceContext(SyntaxContext, SyntaxContextKind::Expr);
SyntaxParsingContext ExprSequenceContext(SyntaxContext, SyntaxContextKind::Expr);

SmallVector<Expr*, 8> SequencedExprs;
SourceLoc startLoc = Tok.getLoc();
Expand Down Expand Up @@ -380,8 +380,8 @@ ParserResult<Expr> Parser::parseExprSequence(Diag<> Message,
if (SequencedExprs.size() == 1)
return makeParserResult(SequenceStatus, SequencedExprs[0]);

ExprSequnceContext.createNodeInPlace(SyntaxKind::ExprList);
ExprSequnceContext.setCreateSyntax(SyntaxKind::SequenceExpr);
ExprSequenceContext.createNodeInPlace(SyntaxKind::ExprList);
ExprSequenceContext.setCreateSyntax(SyntaxKind::SequenceExpr);
return makeParserResult(SequenceStatus,
SequenceExpr::create(Context, SequencedExprs));
}
Expand Down Expand Up @@ -583,7 +583,7 @@ ParserResult<Expr> Parser::parseExprUnary(Diag<> Message, bool isExprBasic) {
if (SubExpr.isNull())
return Status;

// We are sure we can create a prefix prefix operator expr now.
// We are sure we can create a prefix operator expr now.
UnaryContext.setCreateSyntax(SyntaxKind::PrefixOperatorExpr);

// Check if we have a unary '-' with number literal sub-expression, for
Expand Down Expand Up @@ -3503,7 +3503,7 @@ ParserResult<Expr> Parser::parseExprPoundUnknown(SourceLoc LSquareLoc) {
/// Handle code completion after pound in expression position.
///
/// In case it's in a stmt condition position, specify \p ParentKind to
/// decide the position accepts #available(...) condtion.
/// decide the position accepts #available(...) condition.
///
/// expr-pound-codecompletion:
/// '#' code-completion-token
Expand Down
6 changes: 3 additions & 3 deletions lib/Parse/ParseIfConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ValidateIfConfigCondition :
return UDRE->getName().getBaseIdentifier().str();
}

/// True for expressions represeting either top level modules
/// True for expressions representing either top level modules
/// or nested submodules.
bool isModulePath(Expr *E) {
auto UDE = dyn_cast<UnresolvedDotExpr>(E);
Expand Down Expand Up @@ -807,8 +807,8 @@ ParserResult<IfConfigDecl> Parser::parseIfConfig(
// We shouldn't skip code if we are building syntax tree.
// The parser will keep running and we just discard the AST part.
DiagnosticSuppression suppression(Context.Diags);
SmallVector<ASTNode, 16> dropedElements;
parseElements(dropedElements, false);
SmallVector<ASTNode, 16> droppedElements;
parseElements(droppedElements, false);
} else {
DiagnosticTransaction DT(Diags);
skipUntilConditionalBlockClose();
Expand Down
2 changes: 1 addition & 1 deletion lib/Parse/ParsePattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ Parser::parseFunctionArguments(SmallVectorImpl<Identifier> &NamePieces,
status |= CurriedParameterClause;
}

// If the decl uses currying syntax, complain that that syntax has gone away.
// If the decl uses currying syntax, complain that syntax has gone away.
if (MultipleParameterLists) {
diagnose(BodyParams->getStartLoc(),
diag::parameter_curry_syntax_removed);
Expand Down
2 changes: 1 addition & 1 deletion lib/Parse/ParseRequests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ParseMembersRequest::evaluate(Evaluator &evaluator,

unsigned bufferID = *sf->getBufferID();

// Lexer diaganostics have been emitted during skipping, so we disable lexer's
// Lexer diagnostics have been emitted during skipping, so we disable lexer's
// diagnostic engine here.
Parser parser(bufferID, *sf, /*No Lexer Diags*/nullptr, nullptr, nullptr);
// Disable libSyntax creation in the delayed parsing.
Expand Down
4 changes: 2 additions & 2 deletions lib/Parse/ParseStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ bool Parser::isStartOfStmt() {
consumeToken(tok::identifier);
consumeToken(tok::colon);

// We treating IDENTIIFIER: { as start of statement to provide missed 'do'
// We treating IDENTIFIER: { as start of statement to provide missed 'do'
// diagnostics. This case will be handled in parseStmt().
if (Tok.is(tok::l_brace)) {
return true;
Expand Down Expand Up @@ -1273,7 +1273,7 @@ ParserResult<PoundAvailableInfo> Parser::parseStmtConditionPoundAvailable() {
isUnavailability = true;
}

SyntaxParsingContext ConditonCtxt(SyntaxContext, Kind);
SyntaxParsingContext ConditionCtxt(SyntaxContext, Kind);
SourceLoc PoundLoc;

PoundLoc = consumeToken(MainToken);
Expand Down
6 changes: 3 additions & 3 deletions lib/Parse/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class TokenRecorder: public ConsumeTokenReceiver {
// Token list ordered by their appearance in the source file.
std::vector<Token> Tokens;

// Registered token kind change. These changes are regiestered before the
// Registered token kind change. These changes are registered before the
// token is consumed, so we need to keep track of them here.
llvm::DenseMap<const void*, tok> TokenKindChangeMap;

Expand Down Expand Up @@ -504,7 +504,7 @@ class TokenRecorder: public ConsumeTokenReceiver {
return;
}

// Update Token kind if a kind update was regiestered before.
// Update Token kind if a kind update was registered before.
auto Found = TokenKindChangeMap.find(Tok.getLoc().
getOpaquePointerValue());
if (Found != TokenKindChangeMap.end()) {
Expand Down Expand Up @@ -790,7 +790,7 @@ void Parser::skipListUntilDeclRBrace(SourceLoc startLoc, tok T1, tok T2) {
consumeToken();

// If the following token is either <identifier> or :, it means that
// this `var` or `let` shoud be interpreted as a label
// this `var` or `let` should be interpreted as a label
if ((Tok.canBeArgumentLabel() && peekToken().is(tok::colon)) ||
peekToken().is(tok::colon)) {
backtrack.cancelBacktrack();
Expand Down
8 changes: 4 additions & 4 deletions lib/Parse/SyntaxParsingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,21 +302,21 @@ void SyntaxParsingContext::createNodeInPlace(SyntaxKind Kind,
}
}

void SyntaxParsingContext::collectNodesInPlace(SyntaxKind ColletionKind,
void SyntaxParsingContext::collectNodesInPlace(SyntaxKind CollectionKind,
SyntaxNodeCreationKind nodeCreateK) {
assert(isCollectionKind(ColletionKind));
assert(isCollectionKind(CollectionKind));
assert(isTopOfContextStack());
if (!Enabled)
return;
auto Parts = getParts();
auto Count = 0;
for (auto I = Parts.rbegin(), End = Parts.rend(); I != End; ++I) {
if (!SyntaxFactory::canServeAsCollectionMemberRaw(ColletionKind, I->getKind()))
if (!SyntaxFactory::canServeAsCollectionMemberRaw(CollectionKind, I->getKind()))
break;
++Count;
}
if (Count)
createNodeInPlace(ColletionKind, Count, nodeCreateK);
createNodeInPlace(CollectionKind, Count, nodeCreateK);
}

static ParsedRawSyntaxNode finalizeSourceFile(RootContextData &RootData,
Expand Down
4 changes: 2 additions & 2 deletions test/AutoDiff/Parse/transpose_attr_parse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ func transpose(v: Float) -> Float
func transpose(v: Float) -> Float

// NOTE: The "expected ',' separator" diagnostic is not ideal.
// Ideally, the diagnostic should point out that that `Swift.Float.+(_:_)` is
// Ideally, the diagnostic should point out that `Swift.Float.+(_:_)` is
// not a valid declaration name (missing colon after second argument label).
// expected-error @+2 {{expected ',' separator}}
// expected-error @+1 {{expected declaration}}
@transpose(of: Swift.Float.+(_:_))
func transpose(v: Float) -> Float

// NOTE: The "expected ',' separator" diagnostic is not ideal.
// Ideally, the diagnostic should point out that that `Swift.Float.+.a` is
// Ideally, the diagnostic should point out that `Swift.Float.+.a` is
// not a valid declaration name.
// expected-error @+2 {{expected ',' separator}}
// expected-error @+1 {{expected declaration}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-typecheck-verify-swift -parse-as-library -D FOO

// '-parse-as-library' doesn't allow exprssions nor statements in #if blocks.
// '-parse-as-library' doesn't allow expressions nor statements in #if blocks.

func foo() {}

Expand Down
2 changes: 1 addition & 1 deletion test/Parse/availability_query_unavailability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ if case 42 = 42, #available(macOS 10.51, *), #unavailable(macOS 10.52) { // expe
if #available(macOS 10.51, *), case 42 = 42, #unavailable(macOS 10.52) { // expected-error {{#available and #unavailable cannot be in the same statement}}
}

// Allow availabiility and unavailability to mix if they are not in the same statement.
// Allow availability and unavailability to mix if they are not in the same statement.
if #unavailable(macOS 11) {
if #available(macOS 10, *) { }
}
Expand Down
Loading