From 9ca38d23a0d2a3032c4fc923f1f2952638ead4c3 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Tue, 23 Jun 2009 11:23:03 +0000 Subject: Added test for #2060. --- test/pending/pos/t2060.scala | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/pending/pos/t2060.scala (limited to 'test/pending') diff --git a/test/pending/pos/t2060.scala b/test/pending/pos/t2060.scala new file mode 100644 index 0000000000..3f47259849 --- /dev/null +++ b/test/pending/pos/t2060.scala @@ -0,0 +1,28 @@ +object Test { + class Op[I]; + class IntOp extends Op[Int]; + + class Rich(x : Double) { + def + (op : IntOp) = op; + def + [I](op : Op[I]) = op; + def plus [I](op : Op[I]) = op; + } + + implicit def iToRich(x : Double) = + new Rich(x); + + // fails to compile + val failure = 1.0 + new Op[Int]; + + // works as expected -- + // problem isn't in adding new "+" + val a = 1.0 + new IntOp; + + // works as expected -- + // problem isn't in binding type variable I + val b = 1.0 plus new Op[Int]; + + // works as expected -- + // problem isn't in using Rich.+[I](op : Op[I]) + val c = iToRich(1.0) + new Op[Int]; +} -- cgit v1.2.3