mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Print diagnostic groups as part of the LLVM printer in the same manner as the
Swift one does, always. Make `-print-diagnostic-groups` an inert option, since we
always print diagnostic group names with the `[#GroupName]` syntax.
As part of this, we no longer render the diagnostic group name as part
of the diagnostic *text*, instead leaving it up to the diagnostic
renderer to handle the category appropriately. Update all of the tests
that were depending on `-print-diagnostic-groups` putting it into the
text to instead use the `{{documentation-file=<file name>}}`
diagnostic verification syntax.
9 lines
562 B
Swift
9 lines
562 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 5
|
|
|
|
let a = [10, 20, 30, 40, 50, 60]
|
|
|
|
_ = a.index(of: 30) // expected-warning {{'index(of:)' is deprecated: renamed to 'firstIndex(of:)'}}{{documentation-file=deprecated-declaration}} expected-note {{use 'firstIndex(of:)' instead}}
|
|
_ = a.firstIndex(of: 30)
|
|
_ = a.index(where: { $0 > 30 }) // expected-warning {{'index(where:)' is deprecated: renamed to 'firstIndex(where:)'}}{{documentation-file=deprecated-declaration}} expected-note {{use 'firstIndex(where:)' instead}}
|
|
_ = a.firstIndex(where: { $0 > 30 })
|