Skip to content

Commit

Permalink
Implied Conversion -> Implicit Conversion
Browse files Browse the repository at this point in the history
Implied felt forced in this context
  • Loading branch information
odersky committed Feb 1, 2019
1 parent b5bd2b9 commit 2a4a19e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/docs/reference/contextual/conversions.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
layout: doc-page
title: "Inferable Conversions"
title: "Implicit Conversions"
---

Inferable conversions are defined by implied instances of the `scala.Conversion` class.
Implicit conversions are defined by implied instances of the `scala.Conversion` class.
This class is defined in package `scala` as follows:
```scala
abstract class Conversion[-T, +U] extends (T => U)
```
For example, here is an inferable conversion from `String` to `Token`:
For example, here is an implicit conversion from `String` to `Token`:
```scala
implied for Conversion[String, Token] {
def apply(str: String): Token = new KeyWord(str)
}
```
An inferable conversion is applied automatically by the compiler in three situations:
An implicit conversion is applied automatically by the compiler in three situations:

1. If an expression `e` has type `T`, and `T` does not conform to the expression's expected type `S`.
2. In a selection `e.m` with `e` of type `T`, but `T` defines no member `m`.
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/contextual/query-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: doc-page
title: "Context Queries"
---

_Context queries_ are functions with inferable parameters.
_Context queries_ are functions with (only) inferable parameters.
_Context query types_ are the types of first-class context queries.
Here is an example for a context query type:
```scala
Expand All @@ -26,7 +26,7 @@ context query literal, `E` is converted to a context query literal by rewriting
given (x_1: T1, ..., x_n: Tn) => E
```
where the names `x_1`, ..., `x_n` are arbitrary. This expansion is performed
before the expression `E` is typechecked, which means that x_1`, ..., `x_n`
before the expression `E` is typechecked, which means that `x_1`, ..., `x_n`
are available as implied instances in `E`.

Like query types, query literals are written with a `given` prefix. They differ from normal function literals in two ways:
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sidebar:
url: docs/reference/derivation.html
- title: Context Queries
url: docs/reference/contextual/query-types.html
- title: Implied Conversions
- title: Implicit Conversions
url: docs/reference/contextual/conversions.html
- title: Inferable By-Name Parameters
url: docs/reference/contextual/inferable-by-name-parameters.html
Expand Down

0 comments on commit 2a4a19e

Please sign in to comment.