You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overload resolution in Scala 3 improves on Scala 2 in two ways.
7
+
Overload resolution in Scala 3 improves on Scala 2 in three ways.
8
8
First, it takes all argument lists into account instead of
9
9
just the first argument list.
10
10
Second, it can infer parameter types of function values even if they
11
11
are in the first argument list.
12
+
Third, default arguments are no longer relevant for prioritization.
12
13
13
14
## Looking Beyond the First Argument List
14
15
@@ -90,3 +91,12 @@ x => x match { case P1 => B1 ... case P_n => B_n }
90
91
```
91
92
92
93
and is therefore also approximated with a `? => ?` type.
94
+
95
+
## Default Arguments Are No longer Relevant for Prioritization
96
+
97
+
In Scala 2 if among several applicative alternatives one alternative had default arguments, that alternative was dropped from consideration. This has the unfortunate
98
+
side effect that adding a default to a parameter of a method can render this method
99
+
invisible in overloaded calls.
100
+
101
+
Scala 3 drops this distinction. Methods with default parameters are not treated
0 commit comments