scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Lint selections from unit value #12728

Closed som-snytt closed 1 year ago

som-snytt commented 1 year ago

Reproduction steps

Scala version: 2.13.10

scala> ().
!=(          (universal)   ==(          (universal)   formatted(  (deprecated)   toString()   (universal)
##           (universal)   asInstanceOf (universal)   getClass()                 →(          (deprecated)
+(          (deprecated)   ensuring(    (universal)   hashCode()   (universal)
->(          (universal)   equals(      (universal)   isInstanceOf (universal)

Problem

None of these is a good idea.

https://github.com/scala/scala/pull/6535#issuecomment-383485026 https://github.com/scala/scala/pull/10293#issuecomment-1434095201

Though the parser now supports () == ()!

lrytz commented 1 year ago

someInt.isNaN and similar could be included (see https://github.com/scala/scala/pull/10313)

som-snytt commented 1 year ago

Another lint request for function values https://github.com/scala/bug/issues/11547#issuecomment-1434149738