Skip to content

Commit e34a065

Browse files
committed
Align error capitalization and make a minor rewording
1 parent 335ae5f commit e34a065

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

userdocs/diagnostics/protocol-type-non-conformance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Notice that it is possible to invoke the method `makeNoise()` on a value of type
2828
```swift
2929
print(Dog.species) // Prints "Canus familiaris"
3030
print(Cat.species) // Prints "Felis catus"
31-
print(Animal.species) // Error
31+
print(Animal.species) // error: static member 'species' cannot be used...
3232
```
3333

3434
Since a type conforms to a protocol only when it satisfies _all_ of that protocol's requirements, the existential type `Animal` does not conform to the protocol `Animal` because it cannot satisfy the protocol's requirement for the static property `species`:
@@ -45,7 +45,7 @@ declareAnimalSpecies(dog)
4545
// "Woof"
4646
// "My species is known as Canus familiaris"
4747
declareAnimalSpecies(animal)
48-
// Error: protocol type 'Animal' cannot conform to 'Animal'...
48+
// error: protocol type 'Animal' cannot conform to 'Animal'...
4949
```
5050

5151
In general, any initializers, static members, and associated types required by a protocol can be used only via conforming concrete types. Although Swift allows a protocol that requires initializers or static members to be used as a type, that type _does not and cannot_ conform to the protocol itself.
@@ -58,4 +58,4 @@ For more on using existential types, see [Protocols as Types](https://docs.swift
5858

5959
## Exceptions
6060

61-
The Swift protocol `Error` has no requirements and, when used as a type, conforms to itself; `@objc` protocols with no static requirements can also be used as types that conform to themselves.
61+
The Swift protocol `Error` has no required members and, when used as a type, conforms to itself; `@objc` protocols with no static requirements can also be used as types that conform to themselves.

0 commit comments

Comments
 (0)