diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-01 16:08:46 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-01 16:08:46 +0100 |
commit | 5ed617b9ac205b831ec69b782472b1afc5752378 (patch) | |
tree | eab7d1dd8608a633222ef53b4005364eca3b2226 /README.md | |
parent | 08e880231ff5facd55a80bed0391b22fe85a9f44 (diff) | |
download | dotty-5ed617b9ac205b831ec69b782472b1afc5752378.tar.gz dotty-5ed617b9ac205b831ec69b782472b1afc5752378.tar.bz2 dotty-5ed617b9ac205b831ec69b782472b1afc5752378.zip |
Better handling of implicits over numeric types.
Compiling scala.math.BigDecimal and scala.math.BigInteger shows a problem.
The conversion `int2bigInt` is not applicable to a Byte because `Byte -> Int`
requires another implicit conversion.
We fix that by using a new method relaxed_<:< for implicit compatibility checks,
which always admits numeric widenings.
This leads to another problem. Now the conversions
implicit def byteToInt(x: Byte): Int
implicit def byteToShort(x: Byte): Short
are ambiguous when we try to convert from Byte to Int.
We fix that by adding a "tie-break" to implicit search
where if several methods match a numeric value result type
and all have numeric value types as result types, we
pick the numerically largest type that matches.
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions