From 5fc4690717dba48da0734d6e9bd88f48170cc765 Mon Sep 17 00:00:00 2001 From: Sukolsak Sakshuwong Date: Mon, 7 Dec 2015 17:34:14 -0800 Subject: [PATCH] Fix typos and formatting in TypeChecker.rst --- docs/TypeChecker.rst | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/TypeChecker.rst b/docs/TypeChecker.rst index 400c799bfc6ce..fb1856eb30645 100644 --- a/docs/TypeChecker.rst +++ b/docs/TypeChecker.rst @@ -126,12 +126,12 @@ the Swift type system: to the second, which includes subtyping and equality. Additionally, it allows a user-defined conversion function to be called. Conversion constraints are written ``X { @@ -376,10 +376,10 @@ has a regular structure. For example, consider the ``Optional`` type:: case Some(T) } -The type of ``Optional.Vone`` is ``Optional``, while the type of +The type of ``Optional.None`` is ``Optional``, while the type of ``Optional.Some`` is ``(T) -> Optional``. In fact, the -type of a enum element can have one of two forms: it can be ``T0``, -for a enum element that has no extra data, or it can be ``T2 -> T0``, +type of an enum element can have one of two forms: it can be ``T0``, +for an enum element that has no extra data, or it can be ``T2 -> T0``, where ``T2`` is the data associated with the enum element. For the latter case, the actual arguments are parsed as part of the unresolved member reference, so that a function application constraint describes @@ -403,8 +403,8 @@ concrete type, so long as that type conforms to the protocol ``Comparable``. The type of ``min`` is (internally) written as `` (x: T, y: T) -> T``, which can be read as "for all ``T``, where ``T`` conforms to ``Comparable``, the type of the function is -``(x: T, y: T) -> T``. Different uses of the ``min`` function may -have different bindings for the generic parameter``T``. +``(x: T, y: T) -> T``." Different uses of the ``min`` function may +have different bindings for the generic parameter ``T``. When the constraint generator encounters a reference to a generic function, it immediately replaces each of the generic parameters within @@ -433,8 +433,8 @@ solver. For example, consider the following generic dictionary type:: // ... } -When the constraint solver encounters the expression `` -Dictionary()``, it opens up the type ``Dictionary``---which has not +When the constraint solver encounters the expression ``Dictionary()``, +it opens up the type ``Dictionary``---which has not been provided with any specific generic arguments---to the type ``Dictionary``, for fresh type variables ``T0`` and ``T1``, and introduces the constraint ``T0 conforms to Hashable``. This allows @@ -530,7 +530,7 @@ constraint ``A.member == B`` can be simplified when the type of ``A`` is determined to be a nominal or tuple type, in which case name lookup can resolve the member name to an actual declaration. That declaration has some type ``C``, so the member constraint is simplified to the -exact equality constraint``B := C``. +exact equality constraint ``B := C``. The member name may refer to a set of overloaded declarations. In this case, the type ``C`` is a fresh type variable (call it ``T0``). A @@ -736,12 +736,12 @@ checking problem:: f(10.5, x) This constraint system generates the constraints "``T(f)`` ==Fn ``T0 --> T1``" (for fresh variables ``T0`` and ``T1``), "``(T2, X)`` T1``" (for fresh variables ``T0`` and ``T1``), "``(T2, X) T1``" constraint has a locator that is anchored at the function application and a path with the "apply function" derivation step, meaning that this is the function being -applied. Similarly, the "``(T2, X)``