Skip to content

Commit 73da792

Browse files
committed
Make -> sugar an inline method
Must wait for 3.10.0 currently it is transparent inline, to avoid inline proxy objects appearing in capture sets and breaking type checking.
1 parent ba45875 commit 73da792

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/src/scala/Predef.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ object Predef extends LowPriorityImplicits {
389389
// implicit classes -----------------------------------------------------
390390

391391
/** @group implicit-classes-any */
392+
@deprecated("Use `->` extension method instead.", since = "3.10.0")
392393
implicit final class ArrowAssoc[A](private val self: A) extends AnyVal {
394+
@deprecated("Use `->` extension method instead.", since = "3.10.0")
393395
@inline def -> [B](y: B): (A, B) = (self, y)
394396
@deprecated("Use `->` instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.", "2.13.0")
395397
def [B](y: B): (A, B) = ->(y)
@@ -609,6 +611,11 @@ object Predef extends LowPriorityImplicits {
609611
*/
610612
inline def runtimeChecked: x.type @RuntimeChecked = x: @RuntimeChecked
611613

614+
// extension method sugar ---------------------------------------------
615+
extension[A] (self: A)
616+
transparent inline def -> [B](y: B): (A, B) = (self, y)
617+
618+
612619
}
613620

614621
/** The `LowPriorityImplicits` class provides implicit values that

0 commit comments

Comments
 (0)