diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-06-23 11:23:03 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-06-23 11:23:03 +0000 |
commit | 9ca38d23a0d2a3032c4fc923f1f2952638ead4c3 (patch) | |
tree | 2e7b9a4706161e8483028227cfa3a4da35104936 /test/pending/pos | |
parent | 76294e00c5f3cb6101d83c7d982a2be6b6575e6a (diff) | |
download | scala-9ca38d23a0d2a3032c4fc923f1f2952638ead4c3.tar.gz scala-9ca38d23a0d2a3032c4fc923f1f2952638ead4c3.tar.bz2 scala-9ca38d23a0d2a3032c4fc923f1f2952638ead4c3.zip |
Added test for #2060.
Diffstat (limited to 'test/pending/pos')
-rw-r--r-- | test/pending/pos/t2060.scala | 28 |
1 files changed, 28 insertions, 0 deletions
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]; +} |