Skip to content

Commit abca5b0

Browse files
committed
Rename into to convert
1 parent 6501dc4 commit abca5b0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

library/src/scala/Conversion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ object Conversion:
2929

3030
extension [T](x: T)
3131
/** `x.into[U]` converts a value `x` of type `T` to type `U` */
32-
def into[U](using c: Conversion[T, U]) = c(x)
32+
def convert[U](using c: Conversion[T, U]) = c(x)

tests/pos/conversion-into.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/pos/convert.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Conversion.convert
2+
3+
given Conversion[String, Int] = _.length
4+
given Conversion[Int, String] = _.toString
5+
6+
def f(x: String): Int = x.convert
7+
def g(x: Int): String = x.convert[String]

0 commit comments

Comments
 (0)