diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-06-22 14:05:52 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-06-22 14:05:52 +0000 |
commit | 6e372ca4770ff87d81ceb540b87a1f66fc1055aa (patch) | |
tree | 41c9f2401129da13d2eb2d08da80a99e9d9ed846 /test/files/run/impconvtimes.scala | |
parent | 511aa6f2e4103d2742259902c0b1825a9c9650e1 (diff) | |
download | scala-6e372ca4770ff87d81ceb540b87a1f66fc1055aa.tar.gz scala-6e372ca4770ff87d81ceb540b87a1f66fc1055aa.tar.bz2 scala-6e372ca4770ff87d81ceb540b87a1f66fc1055aa.zip |
tweaked the output and the check file
Diffstat (limited to 'test/files/run/impconvtimes.scala')
-rw-r--r-- | test/files/run/impconvtimes.scala | 17 |
1 files changed, 17 insertions, 0 deletions
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)) + } +} |