mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Diagnostics] SR-11419 Diagnose protocol stub note in editor mode only (#28101)
* [TypeChecker] Enclosing stubs protocol note within editor mode * [test] Removing note from test where there is no -diagnostics-editor-mode flag * Formatting modified code * [tests] Fixing tests under validation-tests
This commit is contained in:
committed by
Robert Widmann
parent
d9b03a56a9
commit
1184492d25
@@ -35,16 +35,16 @@ let _ = IntKey(intValue: 3)
|
||||
|
||||
// Enums with a different raw value conforming to CodingKey should not get
|
||||
// implicit derived conformance.
|
||||
enum Int8Key : Int8, CodingKey { // expected-error {{type 'Int8Key' does not conform to protocol 'CodingKey'}} expected-note 4 {{do you want to add protocol stubs?}}
|
||||
enum Int8Key : Int8, CodingKey { // expected-error {{type 'Int8Key' does not conform to protocol 'CodingKey'}}
|
||||
case a = -1, b = 0, c = 1
|
||||
}
|
||||
|
||||
// Structs conforming to CodingKey should not get implicit derived conformance.
|
||||
struct StructKey : CodingKey { // expected-error {{type 'StructKey' does not conform to protocol 'CodingKey'}} expected-note 4 {{do you want to add protocol stubs?}}
|
||||
struct StructKey : CodingKey { // expected-error {{type 'StructKey' does not conform to protocol 'CodingKey'}}
|
||||
}
|
||||
|
||||
// Classes conforming to CodingKey should not get implict derived conformance.
|
||||
class ClassKey : CodingKey { //expected-error {{type 'ClassKey' does not conform to protocol 'CodingKey'}} expected-note 4 {{do you want to add protocol stubs?}}
|
||||
class ClassKey : CodingKey { //expected-error {{type 'ClassKey' does not conform to protocol 'CodingKey'}}
|
||||
}
|
||||
|
||||
// Types which are valid for CodingKey derived conformance should not get that
|
||||
|
||||
Reference in New Issue
Block a user