mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Adjust the valid position checking and special handle EOF position. If the requested location is at EOF, use the last token, but still emit the diagnostics at the specificied location. rdar://138426038
14 lines
565 B
Swift
14 lines
565 B
Swift
// RUN: not %target-swift-frontend -diagnostic-style=swift -typecheck %/s 2>&1 | %FileCheck %s
|
|
|
|
// REQUIRES: swift_swift_parser
|
|
|
|
// CHECK: {{SOURCE_DIR[/\]test[/\]diagnostics[/\]pretty-printed-diagnostics-eof\.swift}}:[[#LINE:]]:1: error: expected '}' in struct
|
|
// CHECK: [[#LINE-2]] | struct MyStruct {
|
|
// CHECK-NEXT: | `- note: to match this opening '{'
|
|
// CHECK-NEXT: [[#LINE-1]] | func foo() {}
|
|
// CHECK-NEXT: [[#LINE]] |
|
|
// CHECK-NEXT: | `- error: expected '}' in struct
|
|
|
|
struct MyStruct {
|
|
func foo() {}
|