Files
swift-mirror/test/Parse/brace_recovery_eof.swift
Argyrios Kyrtzidis 74ba1e8851 [Parser] In Parser::parseBraceItemList, when we don't find a right brace recover by using the PreviousLoc.
This ensures that the brace range will include all contained items.
The previous scheme of choosing the end location of the last item was not accurate because for pattern bindings decls
we also push the var decls as items, but they don't have the full source range of the pattern binding decl.

Fixes rdar://15190792.

Swift SVN r9293
2013-10-13 18:50:53 +00:00

7 lines
227 B
Swift

// RUN: %swift %s -parse -verify
// Make sure source ranges satisfy the verifier.
for foo in [1, 2] { // expected-note {{to match this opening '{'}}
var x = foo
// expected-error@+1{{expected '}' at end of brace statement}}