Skip to content

Commit 67fcf92

Browse files
committed
Define the with a given clause
Can do it now that we have a full bootstrap.
1 parent 648d60b commit 67fcf92

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

library/src-3.x/dotty/DottyPredef.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ object DottyPredef {
3636
case ev: ValueOf[T] => ev.value
3737
}
3838

39-
inline def the[T](implicit x: T): x.type = x
39+
inline def the[T] given (x: T): x.type = x
4040
}

tests/pos/the-given.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
object Test {
2+
3+
class Encoder { def apply(x: Int): Int = x }
4+
implied for Encoder
5+
6+
the[Encoder](2)
7+
8+
}

0 commit comments

Comments
 (0)