From 9c4df91f4cbfef95f937dfd4180f46437d61e93e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 4 Jul 2019 14:04:02 +0200 Subject: [PATCH 1/2] Fix #6801: Add test --- tests/pos/i6801.scala | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/pos/i6801.scala diff --git a/tests/pos/i6801.scala b/tests/pos/i6801.scala new file mode 100644 index 000000000000..f6ef3dfbcd8b --- /dev/null +++ b/tests/pos/i6801.scala @@ -0,0 +1,5 @@ +delegate MyNumericOps[T] { + def (x: T) +(y: T) given (n: Numeric[T]): T = n.plus(x,y) +} +def foo[T: Numeric](x: T) = 1f + x // error: no implicit argument of type Numeric[Any] +def bar[T: Numeric](x: T) = x + 1f // error: no implicit argument of type Numeric[Any] \ No newline at end of file From 6d52b0e3ab28db96542fcb646c9be30e0abe18e5 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 4 Jul 2019 17:10:07 +0200 Subject: [PATCH 2/2] Move test to right directory --- tests/{pos => neg}/i6801.scala | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{pos => neg}/i6801.scala (100%) diff --git a/tests/pos/i6801.scala b/tests/neg/i6801.scala similarity index 100% rename from tests/pos/i6801.scala rename to tests/neg/i6801.scala