Skip to content

Commit 4efdf56

Browse files
committed
revert 'complain for invalid enum raw value'
and all changes introduced in the same pull request
1 parent cd62d52 commit 4efdf56

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4398,7 +4398,6 @@ ParserStatus Parser::parseDeclEnumCase(ParseDeclOptions Flags,
43984398

43994399
// See if there's a raw value expression.
44004400
SourceLoc EqualsLoc;
4401-
auto NextLoc = peekToken().getLoc();
44024401
ParserResult<Expr> RawValueExpr;
44034402
LiteralExpr *LiteralRawValueExpr = nullptr;
44044403
if (Tok.is(tok::equal)) {
@@ -4413,7 +4412,6 @@ ParserStatus Parser::parseDeclEnumCase(ParseDeclOptions Flags,
44134412
return Status;
44144413
}
44154414
if (RawValueExpr.isNull()) {
4416-
diagnose(NextLoc, diag::nonliteral_enum_case_raw_value);
44174415
Status.setIsParseError();
44184416
return Status;
44194417
}

test/decl/enum/enumtest.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,4 @@ func testSimpleEnum() {
290290
let _ : SimpleEnum=.X // expected-error {{'=' must have consistent whitespace on both sides}}
291291
}
292292

293-
enum SR510: String {
294-
case Thing = "thing"
295-
case Bob = {"test"} // expected-error {{raw value for enum case must be a literal}}
296-
}
297-
298293

0 commit comments

Comments
 (0)