Skip to content

Commit 0e74121

Browse files
committed
Error when parsing the empty record type
Issue #1200
1 parent 9a269a3 commit 0e74121

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/comp/syntax/parse/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ fn parse_ty(p: parser, colons_before_params: bool) -> @ast::ty {
517517
let elems =
518518
parse_seq(token::LBRACE, token::RBRACE, seq_sep_opt(token::COMMA),
519519
parse_ty_field, p);
520+
if vec::len(elems.node) == 0u { unexpected(p, token::RBRACE); }
520521
let hi = elems.span.hi;
521522
t = ast::ty_rec(elems.node);
522523
if p.peek() == token::COLON {

0 commit comments

Comments
 (0)