aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/implicits1.scala
Commit message (Collapse)AuthorAgeFilesLines
* Better handling of implicits over numeric types.Martin Odersky2015-11-011-0/+4
| | | | | | | | | | | | | | | | | | | | 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.
* Remove trailing spaces in Dotty tests.Dmitry Petrashko2015-04-091-1/+1
|
* Added test for implicits which fail in Scala 2.11.Martin Odersky2014-03-121-2/+10
| | | | Mentioned in scala-user by Haoyi Li on 12-Mar-2014
* Relaxing check that implicits must have explicit return typeMartin Odersky2014-02-021-1/+1
| | | | | | Now this is required only for members of a template. Local statements can still have implicits with no result type. (Maybe we need to get back on this). Also, changed Dotty itself and tests to adhere to the new restriction.
* Implemented "two-hop" implicit adaptation.Martin Odersky2013-09-081-1/+1
| | | | | | That is, in a selection qual.name(args), qual can be adapted to obtain a member "name" that matches args. Important to make usage patterns like this one work: 1 + BigInt(x)
* Improvements in implicits error reportingMartin Odersky2013-09-061-1/+1
| | | | Plus a few bugfixes for implicits
* Several fixes in typer.Martin Odersky2013-09-051-0/+10
| | | | Also updated tests.
* Fixed bugs related to typechecking closures.Martin Odersky2013-08-271-1/+15
|
* Fixes in implicit handlingMartin Odersky2013-08-231-2/+6
| | | | Plus a new test file: implicits1
* Added some first test files to compileMartin Odersky2013-08-221-0/+17