@@ -346,19 +346,6 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
346346 implicit def double2Double (x : Double ) = java.lang.Double .valueOf(x)
347347 implicit def boolean2Boolean (x : Boolean ) = java.lang.Boolean .valueOf(x)
348348
349- // These next eight implicits exist solely to exclude AnyRef methods from the
350- // eight implicits above so that primitives are not coerced to AnyRefs. They
351- // only create such conflict for AnyRef methods, so the methods on the java.lang
352- // boxed types are unambiguously reachable.
353- implicit def byte2ByteConflict (x : Byte ) = new AnyRef
354- implicit def short2ShortConflict (x : Short ) = new AnyRef
355- implicit def char2CharacterConflict (x : Char ) = new AnyRef
356- implicit def int2IntegerConflict (x : Int ) = new AnyRef
357- implicit def long2LongConflict (x : Long ) = new AnyRef
358- implicit def float2FloatConflict (x : Float ) = new AnyRef
359- implicit def double2DoubleConflict (x : Double ) = new AnyRef
360- implicit def boolean2BooleanConflict (x : Boolean ) = new AnyRef
361-
362349 implicit def Byte2byte (x : java.lang.Byte ): Byte = x.byteValue
363350 implicit def Short2short (x : java.lang.Short ): Short = x.shortValue
364351 implicit def Character2char (x : java.lang.Character ): Char = x.charValue
@@ -481,24 +468,6 @@ private[scala] abstract class LowPriorityImplicits {
481468 @ inline implicit def doubleWrapper (x : Double ) = new runtime.RichDouble (x)
482469 @ inline implicit def booleanWrapper (x : Boolean ) = new runtime.RichBoolean (x)
483470
484- // These eight implicits exist solely to exclude Null from the domain of
485- // the boxed types, so that e.g. "var x: Int = null" is a compile time
486- // error rather than a delayed null pointer exception by way of the
487- // conversion from java.lang.Integer. If defined in the same template as
488- // Integer2int, they would have higher priority because Null is a subtype
489- // of Integer. We balance that out and create conflict by moving the
490- // definition into the superclass.
491- //
492- // Caution: do not adjust tightrope tension without safety goggles in place.
493- implicit def Byte2byteNullConflict (x : Null ): Byte = sys.error(" value error" )
494- implicit def Short2shortNullConflict (x : Null ): Short = sys.error(" value error" )
495- implicit def Character2charNullConflict (x : Null ): Char = sys.error(" value error" )
496- implicit def Integer2intNullConflict (x : Null ): Int = sys.error(" value error" )
497- implicit def Long2longNullConflict (x : Null ): Long = sys.error(" value error" )
498- implicit def Float2floatNullConflict (x : Null ): Float = sys.error(" value error" )
499- implicit def Double2doubleNullConflict (x : Null ): Double = sys.error(" value error" )
500- implicit def Boolean2booleanNullConflict (x : Null ): Boolean = sys.error(" value error" )
501-
502471 implicit def genericWrapArray [T ](xs : Array [T ]): WrappedArray [T ] =
503472 if (xs eq null ) null
504473 else WrappedArray .make(xs)
0 commit comments