Skip to content

Commit 8efe110

Browse files
committed
Lint for integral divisions that are widened to a float
1 parent 2c7bbac commit 8efe110

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

library/src/scala/math/BigInt.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ final class BigInt(val bigInteger: BigInteger)
172172
(shifted.signum != 0) && !(shifted equals BigInt.minusOne)
173173
}
174174

175+
@deprecated("isWhole on an integer type is always true", "2.12.15")
175176
def isWhole() = true
176177
def underlying = bigInteger
177178

library/src/scala/runtime/RichInt.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ final class RichInt(val self: Int) extends AnyVal with ScalaNumberProxy[Int] wit
3131
/** Returns `'''true'''` if this number has no decimal component.
3232
* Always `'''true'''` for `RichInt`.
3333
*/
34+
@deprecated("isWhole on an integer type is always true", "2.12.15")
3435
def isWhole() = true
3536

3637
override def isValidInt = true

library/src/scala/runtime/ScalaNumberProxy.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ trait ScalaNumberProxy[T] extends Any with ScalaNumericAnyConversions with Typed
4545
def signum = num.signum(self)
4646
}
4747
trait ScalaWholeNumberProxy[T] extends Any with ScalaNumberProxy[T] {
48+
@deprecated("isWhole on an integer type is always true", "2.12.15")
4849
def isWhole() = true
4950
}
5051
trait IntegralProxy[T] extends Any with ScalaWholeNumberProxy[T] with RangedProxy[T] {

0 commit comments

Comments
 (0)