Skip to content

Commit ef62605

Browse files
authored
Merge pull request #6806 from dotty-staging/test-#6801
Fix #6801: Add test
2 parents e59cd6c + 6d52b0e commit ef62605

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/neg/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)