mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`. To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing. rdar://129283608
29 lines
1.1 KiB
Swift
29 lines
1.1 KiB
Swift
// RUN: %target-typecheck-verify-swift
|
|
extension Bool: @retroactive ExpressibleByIntegerLiteral {
|
|
public init(integerLiteral value: Int) {
|
|
self = value != 0
|
|
}
|
|
}
|
|
|
|
enum IsDefinitelyRecursive : Bool, Equatable, Hashable {
|
|
case recursive=false
|
|
}
|
|
|
|
// expected-error@+2 {{'IsRecursive' declares raw type 'Bool', but does not conform to RawRepresentable and conformance could not be synthesized}}
|
|
// expected-note@+1 {{add stubs for conformance}}
|
|
enum IsRecursive : Bool, Equatable, Hashable {
|
|
case recursive=false
|
|
case nonrecursive // expected-error{{enum case must declare a raw value when the preceding raw value is not an integer}}
|
|
}
|
|
|
|
enum IsRecursiveBad1Integral : Bool, Equatable, Hashable {
|
|
case recursive = 0
|
|
case nonrecursive
|
|
}
|
|
|
|
// expected-error@+2 {{'IsRecursiveBad2' declares raw type 'Int', but does not conform to RawRepresentable and conformance could not be synthesized}}
|
|
// expected-note@+1 {{add stubs for conformance}}
|
|
enum IsRecursiveBad2 : Int, Equatable, Hashable {
|
|
case recursive = false // expected-error{{cannot convert value of type 'Bool' to raw type 'Int'}}
|
|
}
|