Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b0012a

Browse files
committed
Merge pull requestscala#461 from ThibaudDauce/fix-typo-views-example
fix: fix typo in view example
2 parents446837c +97f9d61 commit5b0012a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎tutorials/tour/views.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tutorial-previous: implicit-parameters
1313
[Implicit parameters](implicit-parameters.html) and methods can also define implicit conversions called_views_. A view from type`S` to type`T` is defined by an implicit value which has function type`S => T`, or by an implicit method convertible to a value of that type.
1414

1515
Views are applied in two situations:
16+
1617
* If an expression`e` is of type`S`, and`S` does not conform to the expression's expected type`T`.
1718
* In a selection`e.m` with`e` of type`T`, if the selector`m` does not denote a member of`T`.
1819

@@ -26,7 +27,7 @@ The following operation on the two lists xs and ys of type `List[Int]` is legal:
2627
assuming the implicit methods`list2ordered` and`int2ordered` defined below are in scope:
2728

2829
implicit def list2ordered[A](x: List[A])
29-
(implicit elem2ordered:a => Ordered[A]): Ordered[List[A]] =
30+
(implicit elem2ordered:A => Ordered[A]): Ordered[List[A]] =
3031
new Ordered[List[A]] { /* .. */ }
3132

3233
implicit def int2ordered(x: Int): Ordered[Int] =

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp