mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We've been converging the implementations of educational notes and diagnostic groups, where both provide category information in diagnostics (e.g., `[#StrictMemorySafety]`) and corresponding short-form documentation files. The diagnostic group model is more useful in a few ways: * It provides warnings-as-errors control for warnings in the group * It is easier to associate a diagnostic with a group with GROUPED_ERROR/GROUPED_WARNING than it is to have a separate diagnostic ID -> mapping. * It is easier to see our progress on diagnostic-group coverage * It provides an easy name to use for diagnostic purposes. Collapse the educational-notes infrastructure into diagnostic groups, migrating all of the existing educational notes into new groups. Simplify the code paths that dealt with multiple educational notes to have a single, possibly-missing "category documentation URL", which is how we're treating this.
23 lines
1021 B
Swift
23 lines
1021 B
Swift
// not %target-swift-frontend -no-color-diagnostics -print-educational-notes -diagnostic-documentation-path %S/test-docs/ -typecheck %s
|
|
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: not %target-swift-frontend -typecheck -no-color-diagnostics -print-educational-notes -diagnostic-documentation-path %S/test-docs/ -serialize-diagnostics-path %t/serialized.dia %s
|
|
// RUN: c-index-test -read-diagnostics %t/serialized.dia > %t/serialized.txt 2>&1
|
|
// RUN: %FileCheck %s < %t/serialized.txt
|
|
|
|
typealias Fn = () -> ()
|
|
extension Fn {}
|
|
// CHECK: [[@LINE-1]]:1: error: non-nominal type 'Fn' (aka '() -> ()') cannot be extended [{{.*}}nominal-types.md] [NominalTypes]
|
|
|
|
|
|
// Shares the flag record with `Fn`
|
|
typealias Dup = () -> ()
|
|
extension Dup {}
|
|
// CHECK: [[@LINE-1]]:1: error: non-nominal type 'Dup' (aka '() -> ()') cannot be extended [{{.*}}nominal-types.md] [NominalTypes]
|
|
|
|
do {
|
|
func noNote(_: Int) {}
|
|
noNote("Hello")
|
|
// CHECK: [[@LINE-1]]:10: error: cannot convert value of type 'String' to expected argument type 'Int' [] []
|
|
}
|