@@ -367,12 +367,12 @@ issue noted in the prior section is that this constraint does not give
367367the solver enough information to determine `` T0 `` without
368368guesswork. However, we note that the type of an enum member actually
369369has a regular structure. For example, consider the `` Optional `` type::
370-
370+ ``` swift
371371 enum Optional <T > {
372372 case none
373373 case some (T)
374374 }
375-
375+ ```
376376The type of `` Optional<T>.none `` is `` Optional<T> `` , while the type of
377377`` Optional<T>.some `` is `` (T) -> Optional<T> `` . In fact, the
378378type of an enum element can have one of two forms: it can be `` T0 `` ,
@@ -388,12 +388,12 @@ The Swift language includes generics, a system of constrained
388388parameter polymorphism that enables polymorphic types and
389389functions. For example, one can implement a `` min `` function as,
390390e.g.,::
391-
391+ ``` swift
392392 func min <T : Comparable >(x : T, y : T) -> T {
393393 if y < x { return y }
394394 return x
395395 }
396-
396+ ```
397397Here, `` T `` is a generic parameter that can be replaced with any
398398concrete type, so long as that type conforms to the protocol
399399`` Comparable `` . The type of `` min `` is (internally) written as ``<T :
@@ -424,11 +424,11 @@ cannot declare a variable of type ``<T> T -> T``.
424424
425425Uses of generic types are also immediately opened by the constraint
426426solver. For example, consider the following generic dictionary type::
427-
427+ ``` swift
428428 class Dictionary <Key : Hashable , Value > {
429429 // ...
430430 }
431-
431+ ```
432432When the constraint solver encounters the expression `` Dictionary() `` ,
433433it opens up the type `` Dictionary `` ---which has not
434434been provided with any specific generic arguments---to the type
@@ -496,9 +496,9 @@ relationship constraints proceeds by comparing the structure of the
496496two types and applying the typing rules of the Swift language to
497497generate additional constraints. For example, if the constraint is a
498498conversion constraint::
499-
499+ ```
500500 A -> B <c C -> D
501-
501+ ```
502502then both types are function types, and we can break down this
503503constraint into two smaller constraints `` C < A `` and `` B < D `` by
504504applying the conversion rule for function types. Similarly, one can
@@ -715,7 +715,7 @@ well as during diagnostics emission, it is important to track the
715715relationship between the constraints and the actual AST nodes from
716716which they originally came. For example, consider the following type
717717checking problem::
718- ```
718+ ``` swift
719719 struct X {
720720 // user-defined conversions
721721 func [conversion] __conversion () -> String { /* ... */ }
@@ -827,7 +827,7 @@ Simplification does not always exhaust the complete path. For example,
827827consider a slight modification to our example, so that the argument to
828828`` f `` is provided by another call, we get a different result
829829entirely::
830- ```
830+ ``` swift
831831 func f (_ i : Int , s : String ) { }
832832 func g () -> (f : Float , x : X) { }
833833
@@ -844,9 +844,9 @@ argument" derivation step takes us to the argument expression
844844element of `` g() `` , because it's simple part of the tuple returned
845845from `` g `` . At this point, simplification ceases, and creates the
846846simplified locator::
847-
847+ ```
848848 function application of g -> tuple element #0
849-
849+ ```
850850### Performance
851851
852852The performance of the type checker is dependent on a number of
0 commit comments