Skip to content

Commit 02ff3f5

Browse files
committed
spelling: to which methods are applied
Signed-off-by: Josh Soref <[email protected]>
1 parent a642f55 commit 02ff3f5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

_posts/2016-04-11-release-notes-2.12.0-M4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ As of [#4971](https://github.com/scala/scala/pull/4971), we treat Single Abstrac
7373
(new C[Int]) sort ((a: Int, b: Int) => a - b) // ok
7474

7575
The first attempt fails because the type checker cannot infer the types for `_ - _`'s arguments anymore.
76-
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments the methods are applied to. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that `Comparator[?]` and `(?, ?) => ?` are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the `Function2` overload).
76+
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments to which methods are applied. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that `Comparator[?]` and `(?, ?) => ?` are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the `Function2` overload).
7777

7878
Finally, implicit conversion of SAM types to Function types won't kick in anymore, since the compiler does this conversion itself first:
7979

_posts/2016-06-29-release-notes-2.12.0-M5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ As of [#4971](https://github.com/scala/scala/pull/4971), we treat Single Abstrac
9696
(new C[Int]) sort ((a: Int, b: Int) => a - b) // ok
9797

9898
The first attempt fails because the type checker cannot infer the types for `_ - _`'s arguments anymore.
99-
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments the methods are applied to. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that `Comparator[?]` and `(?, ?) => ?` are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the `Function2` overload).
99+
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments to which methods are applied. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that `Comparator[?]` and `(?, ?) => ?` are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the `Function2` overload).
100100

101101
Finally, implicit conversion of SAM types to Function types won't kick in anymore, since the compiler does this conversion itself first:
102102

_posts/2016-09-06-release-notes-2.12.0-RC1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ As of [#4971](https://github.com/scala/scala/pull/4971), we treat Single Abstrac
153153
(new C[Int]) sort ((a: Int, b: Int) => a - b) // ok
154154

155155
The first attempt fails because the type checker cannot infer the types for `_ - _`'s arguments anymore.
156-
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments the methods are applied to. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that `Comparator[?]` and `(?, ?) => ?` are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the `Function2` overload).
156+
Type inference in this scenario only works when we can narrow the overloads down to one before type checking the arguments to which methods are applied. When a function is passed as an argument to an overloaded method, we do this by considering the "shape" of the function (essentially, its arity). Now that `Comparator[?]` and `(?, ?) => ?` are both considered functions of arity two, our clever scheme breaks down and the programmer must either select an overload (second application) or make the argument types explicit (last application, which resolves to the `Function2` overload).
157157

158158
Finally, implicit conversion of SAM types to Function types won't kick in anymore, since the compiler does this conversion itself first:
159159

0 commit comments

Comments
 (0)