diff --git a/compiler/parser.nim b/compiler/parser.nim index 4b7ba97adb..677aa57ba2 100755 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1177,7 +1177,11 @@ proc parseObjectCase(p: var TParser): PNode = eat(p, tkColon) else: break skipComment(p, b) - addSon(b, parseObjectPart(p)) + var fields = parseObjectPart(p) + if fields.kind == nkEmpty: + parMessage(p, errIdentifierExpected, p.tok) + fields = newNodeP(nkNilLit, p) # don't break further semantic checking + addSon(b, fields) addSon(result, b) if b.kind == nkElse: break diff --git a/todo.txt b/todo.txt index 1dd27d655a..2ccd486521 100755 --- a/todo.txt +++ b/todo.txt @@ -23,7 +23,6 @@ version 0.9.0 Bugs ---- -- the parser allows empty object case branches - bug: generic assign still buggy - Optimization: If we use a temporary for the result anyway the code gen should make use of this fact to generate better code...