diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/impconvtimes.check | 2 | ||||
-rw-r--r-- | test/files/run/impconvtimes.scala | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/test/files/run/impconvtimes.check b/test/files/run/impconvtimes.check index bc51b7ffe2..f08574de3e 100644 --- a/test/files/run/impconvtimes.check +++ b/test/files/run/impconvtimes.check @@ -1 +1 @@ -3.0 * Hour = Measure(3.0, Test.Hour)
\ No newline at end of file +3.0 * Hour = Measure(3.0,Hour) diff --git a/test/files/run/impconvtimes.scala b/test/files/run/impconvtimes.scala new file mode 100644 index 0000000000..8c5ab61779 --- /dev/null +++ b/test/files/run/impconvtimes.scala @@ -0,0 +1,17 @@ +object Test { + abstract class Unit + object NoUnit extends Unit + object Hour extends Unit { override def toString = "Hour" } + + case class Measure(scalar: Double, unit: Unit) { + def *(newUnit: Unit) = Measure(scalar, newUnit) + } + + implicit def double2Measure(scalar: Double) = + Measure(scalar, NoUnit) + + + def main(args: Array[String]): scala.Unit = { + Console.println("3.0 * Hour = " + (3.0 * Hour)) + } +} |