Files
swift-mirror/test/diagnostics/pretty-printed-diagnostics-eof.swift
Rintaro Ishizaki 40c8d817fb [Diagnostics] Support "swift" style diagnostics at EOF
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
2024-11-21 06:27:37 -08:00

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() {}