diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-10 16:29:40 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-10 16:31:47 -0700 |
commit | 839fd6e55b178b5c2a7aeaa7c9a542fd3637fe01 (patch) | |
tree | 514e8fbfc2acc55b61d79e0d20bdc967c5894db9 /09-implicit-parameters-and-views.md | |
parent | fa4aba59c3dbeb1fe98f743764b17635ee4688ee (diff) | |
download | scala-839fd6e55b178b5c2a7aeaa7c9a542fd3637fe01.tar.gz scala-839fd6e55b178b5c2a7aeaa7c9a542fd3637fe01.tar.bz2 scala-839fd6e55b178b5c2a7aeaa7c9a542fd3637fe01.zip |
github markdown: numbered lists
Diffstat (limited to '09-implicit-parameters-and-views.md')
-rw-r--r-- | 09-implicit-parameters-and-views.md | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/09-implicit-parameters-and-views.md b/09-implicit-parameters-and-views.md index 5d380e86b7..202bf8dbd1 100644 --- a/09-implicit-parameters-and-views.md +++ b/09-implicit-parameters-and-views.md @@ -260,20 +260,20 @@ type. Views are applied in three situations. -#. If an expression $e$ is of type $T$, and $T$ does not conform to the +1. If an expression $e$ is of type $T$, and $T$ does not conform to the expression's expected type $\mathit{pt}$. In this case an implicit $v$ is searched which is applicable to $e$ and whose result type conforms to $\mathit{pt}$. The search proceeds as in the case of implicit parameters, where the implicit scope is the one of `$T$ => $\mathit{pt}$`. If such a view is found, the expression $e$ is converted to `$v$($e$)`. -#. In a selection $e.m$ with $e$ of type $T$, if the selector $m$ does +1. In a selection $e.m$ with $e$ of type $T$, if the selector $m$ does not denote a member of $T$. In this case, a view $v$ is searched which is applicable to $e$ and whose result contains a member named $m$. The search proceeds as in the case of implicit parameters, where the implicit scope is the one of $T$. If such a view is found, the selection $e.m$ is converted to `$v$($e$).$m$`. -#. In a selection $e.m(\mathit{args})$ with $e$ of type $T$, if the selector +1. In a selection $e.m(\mathit{args})$ with $e$ of type $T$, if the selector $m$ denotes some member(s) of $T$, but none of these members is applicable to the arguments $\mathit{args}$. In this case a view $v$ is searched which is applicable to $e$ and whose result contains a method $m$ which is applicable to $\mathit{args}$. @@ -402,31 +402,31 @@ the companion object `scala.reflect.ClassManifest` otherwise. Let $M'$ be the tr `Manifest` if $M$ is trait `Manifest`, or be the trait `OptManifest` otherwise. Then the following rules apply. -#. If $T$ is a value class or one of the classes `Any`, `AnyVal`, `Object`, +1. If $T$ is a value class or one of the classes `Any`, `AnyVal`, `Object`, `Null`, or `Nothing`, a manifest for it is generated by selecting the corresponding manifest value `Manifest.$T$`, which exists in the `Manifest` module. -#. If $T$ is an instance of `Array[$S$]`, a manifest is generated +1. If $T$ is an instance of `Array[$S$]`, a manifest is generated with the invocation `$\mathit{Mobj}$.arrayType[S](m)`, where $m$ is the manifest determined for $M[S]$. -#. If $T$ is some other class type $S\#C[U_1 , \ldots , U_n]$ where the prefix +1. If $T$ is some other class type $S\#C[U_1 , \ldots , U_n]$ where the prefix type $S$ cannot be statically determined from the class $C$, a manifest is generated with the invocation `$\mathit{Mobj}$.classType[T]($m_0$, classOf[T], $ms$)` where $m_0$ is the manifest determined for $M'[S]$ and $ms$ are the manifests determined for $M'[U_1] , \ldots , M'[U_n]$. -#. If $T$ is some other class type with type arguments $U_1 , \ldots , U_n$, +1. If $T$ is some other class type with type arguments $U_1 , \ldots , U_n$, a manifest is generated with the invocation `$\mathit{Mobj}$.classType[T](classOf[T], $ms$)` where $ms$ are the manifests determined for $M'[U_1] , \ldots , M'[U_n]$. -#. If $T$ is a singleton type `$p$.type`, a manifest is generated with +1. If $T$ is a singleton type `$p$.type`, a manifest is generated with the invocation `$\mathit{Mobj}$.singleType[T]($p$)` -#. If $T$ is a refined type $T' \{ R \}$, a manifest is generated for $T'$. +1. If $T$ is a refined type $T' \{ R \}$, a manifest is generated for $T'$. (That is, refinements are never reflected in manifests). -#. If $T$ is an intersection type +1. If $T$ is an intersection type `$T_1$ with $, \ldots ,$ with $T_n$` where $n > 1$, the result depends on whether a full manifest is to be determined or not. @@ -437,7 +437,7 @@ Then the following rules apply. Otherwise, if $M$ is trait `ClassManifest`, then a manifest is generated for the [intersection dominator](#type-erasure) of the types $T_1 , \ldots , T_n$. -#. If $T$ is some other type, then if $M$ is trait `OptManifest`, +1. If $T$ is some other type, then if $M$ is trait `OptManifest`, a manifest is generated from the designator `scala.reflect.NoManifest`. If $M$ is a type different from `OptManifest`, a static error results. |