You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Swift compiler has a setting (under LangOptions) called `DiagnosticsEditorMode`. When set, diagnostics should be customized for an interactive editor that can display and apply complex fix-its, and worry less about the appearance in build logs and command-line environments.
91
-
92
-
Most diagnostics have no reason to change behavior under editor mode. An example of an exception is the "protocol requirements not satisfied diagnostic"; on the command line, it may be better to show all unsatisfied requirements, while in an IDE a single multi-line fix-it would be preferred.
93
-
94
87
### Educational Notes ###
95
88
96
89
Educational notes are short-form documentation attached to a diagnostic which explain relevant language concepts. They are intended to further Swift's goal of progressive disclosure by providing a learning resource at the point of use when encountering an error message for the first time. In very limited circumstances, they also allow the main diagnostic message to use precise terminology (e.g. nominal types) which would otherwise be too unfriendly for beginners.
// expected-error@-1 {{conditional conformance of type 'Pair<A, B>' to protocol 'Collection' does not imply conformance to inherited protocol 'Sequence'}}
14
-
// expected-note@-2 {{did you mean to explicitly state the conformance like 'extension Pair: Sequence where ...'?}}
14
+
// expected-note@-2 {{did you mean to explicitly state the conformance with the same bounds using 'where A == B'?}}
15
+
// expected-note@-3 {{did you mean to explicitly state the conformance with different bounds?}}
extensionCountSteps1 // expected-error {{type 'CountSteps1<T>' does not conform to protocol 'RandomAccessCollection'}}
149
149
// expected-note@-1 {{add stubs for conformance}}
150
150
// expected-error@-2 {{conditional conformance of type 'CountSteps1<T>' to protocol 'RandomAccessCollection' does not imply conformance to inherited protocol 'BidirectionalCollection'}}
151
-
// expected-note@-3 {{did you mean to explicitly state the conformance like 'extension CountSteps1: BidirectionalCollection where ...'?}}
152
-
// expected-error@-4 {{type 'CountSteps1<T>' does not conform to protocol 'BidirectionalCollection'}}
151
+
// expected-note@-3 {{did you mean to explicitly state the conformance with the same bounds using 'where T : Equatable'?}}
152
+
// expected-note@-4 {{did you mean to explicitly state the conformance with different bounds?}}
153
+
// expected-error@-5 {{type 'CountSteps1<T>' does not conform to protocol 'BidirectionalCollection'}}
0 commit comments