Skip to content

Commit 9c4df91

Browse files
committed
Fix #6801: Add test
1 parent 4a107cc commit 9c4df91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/pos/i6801.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
delegate MyNumericOps[T] {
2+
def (x: T) +(y: T) given (n: Numeric[T]): T = n.plus(x,y)
3+
}
4+
def foo[T: Numeric](x: T) = 1f + x // error: no implicit argument of type Numeric[Any]
5+
def bar[T: Numeric](x: T) = x + 1f // error: no implicit argument of type Numeric[Any]

0 commit comments

Comments
 (0)