From 7f6b9b93a15ce6f68bcbdb29f74141541f80b435 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Fri, 23 May 2025 16:22:39 +0200 Subject: [PATCH] chore: mark `eq` and `ne` in Predef as `infix` --- library/src/scala/runtime/stdLibPatches/Predef.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/scala/runtime/stdLibPatches/Predef.scala b/library/src/scala/runtime/stdLibPatches/Predef.scala index 996f68d4e122..bfe554b3e735 100644 --- a/library/src/scala/runtime/stdLibPatches/Predef.scala +++ b/library/src/scala/runtime/stdLibPatches/Predef.scala @@ -56,12 +56,12 @@ object Predef: /** Enables an expression of type `T|Null`, where `T` is a subtype of `AnyRef`, to be checked for `null` * using `eq` rather than only `==`. This is needed because `Null` no longer has * `eq` or `ne` methods, only `==` and `!=` inherited from `Any`. */ - inline def eq(inline y: AnyRef | Null): Boolean = + inline infix def eq(inline y: AnyRef | Null): Boolean = x.asInstanceOf[AnyRef] eq y.asInstanceOf[AnyRef] /** Enables an expression of type `T|Null`, where `T` is a subtype of `AnyRef`, to be checked for `null` * using `ne` rather than only `!=`. This is needed because `Null` no longer has * `eq` or `ne` methods, only `==` and `!=` inherited from `Any`. */ - inline def ne(inline y: AnyRef | Null): Boolean = + inline infix def ne(inline y: AnyRef | Null): Boolean = !(x eq y) extension (opt: Option.type)