Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid REPL completions on null. #12262

Open
lrytz opened this issue Apr 22, 2020 · 4 comments
Open

Invalid REPL completions on null. #12262

lrytz opened this issue Apr 22, 2020 · 4 comments
Labels
Milestone

Comments

@lrytz
Copy link
Member

lrytz commented Apr 22, 2020

scala> null.
takeWhile(                          sameElements(                       lastIndexWhere(                     toSeq
unapply(                            maxOption(                          intersect(                          stripLineEnd
toByte                              union(               (deprecated)   apply(                              equals(               (universal)
andThen(                            orElse(                             isEmpty                             exists(
patch(                              findLast(                           length()                            copyToBuffer(        (deprecated)
...
@SethTisue
Copy link
Member

SethTisue commented Apr 22, 2020

(note that this happens even in 2.12.11 and 2.13.1, before the JLine 3 upgrade. but yeah, good to tackle while we're working on tab completion anyway)

@SethTisue SethTisue transferred this issue from scala/scala-dev Dec 8, 2020
@SethTisue SethTisue added this to the Backlog milestone Dec 8, 2020
@SethTisue SethTisue added the repl label Dec 8, 2020
@jxnu-liguobin
Copy link
Member

scala> null.

It seems that null (Constant) gets incorrect applicableViews during implicit search. What do we expect is to treat null as an Object ? (Perhaps not the most accurate, but it's the smallest set of accurate results.)

@som-snytt
Copy link

Dotty:

scala> null.
!=             ==             eq             getClass       isInstanceOf   notify         synchronized   wait
##             asInstanceOf   equals         hashCode       ne             notifyAll      toString

Spec is at https://scala-lang.org/files/archive/spec/2.13/06-expressions.html#the-null-value

Here is a difference; I was curious whether "maximal subexpression" implies throwing on "a reference to any other member".

scala> null.synchronized
val res0: Any => Any = Lambda$1305/0x0000000801098410@5408d4b3

scala 2.13.6> null.synchronized _
val res0: Nothing => Nothing = $Lambda$1077/0x0000000801008e78@1220ef43

@jxnu-liguobin
Copy link
Member

otty:

scala> null.
!=             ==             eq             getClass       isInstanceOf   notify         synchronized   wait
##             asInstanceOf   equals         hashCode       ne             notifyAll      toString

This looks the same as the candidate for object. “A reference to any other member of the "null" object”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants