GithubHelp home page GithubHelp logo

Comments (6)

lihaoyi avatar lihaoyi commented on July 19, 2024

Yeah i dunno. If you could provide a standalone non-psp repro that'd be great, or even a repro with psp but including any @load.ivy commands necessary to pull psp into the classpath. Not the first time the presentation compiler has disappointed me ^_^

from ammonite.

paulp avatar paulp commented on July 19, 2024

This is really easy to reproduce, or more accurately, you can't help but reproduce it.

// build.sbt
       libraryDependencies += "com.lihaoyi" %% "ammonite-repl" % "0.2.7"
initialCommands in console := "ammonite.repl.Repl.main(null)"

// a.scala
package p {
  trait Direct[A] { def map[B](f: A => B): Direct[B] }
  object Direct { def apply[A](xs: A*): Direct[A] = null }
}

// sbt console transcript
/**
@ 5.<tab>  Display all 733 possibilities? (y or n)
@ Direct(5).map(_.<tab>
getClass              ##                    asInstanceOf          isInstanceOf          toString
hashCode              equals                !=                    ==                    %
/                     *                     -                     +                     ^
&                     |                     >=                    >                     <=
<                     >>                    >>>                   <<                    unary_-
unary_+               unary_~               toDouble              toFloat               toLong
toInt                 toChar                toShort               toByte                ensuring
x                     __resultOfEnsuring    compareTo             doubleValue           floatValue
longValue             intValue              shortValue            byteValue             synchronized
ne                    eq                    wait                  notifyAll             notify
→                     ->                    __leftOfArrow         self                  toOctalString
toHexString           toBinaryString        abs                   max                   min
to                    until                 isWhole               ResultWithoutStep     signum
underlying            compare               isValidChar           isValidInt            isValidShort
isValidByte           formatted

Comes in under 733.

from ammonite.

lihaoyi avatar lihaoyi commented on July 19, 2024

Thanks!

Perhaps I can't help but reproduce it, but it's not always obvious when things which should be there are missing. Having concrete repro examples is always nice

from ammonite.

paulp avatar paulp commented on July 19, 2024

It's a blend of things which should be there missing, but more prominently in this example, things which should be absent being there. Unless Int has a, for instance, NoSuchFieldException member. The last few lines of completions on 5. are

Character                         UnsatisfiedLinkError              InstantiationException
UnknownError                      ArrayStoreException               VerifyError
StackTraceElement                 Deprecated                        Package
IllegalAccessException            NoClassDefFoundError              ClassFormatError
NoSuchMethodException             Thread                            ClassValue
Void                              ClassCircularityError             UnsupportedClassVersionError
FunctionalInterface               Object                            SecurityException
ThreadDeath                       LinkageError                      Comparable
InstantiationError                AssertionError                    IllegalStateException
RuntimePermission                 NoSuchMethodError

It's obviously every simple identifier being presented as Int members.

This may have no cause overlap at all with the Direct(Direct(1)).map(_. example originally given, but when the bugs are this close to the surface it's best to handle some of them so as to see the potentially more interesting ones through less static.

from ammonite.

lihaoyi avatar lihaoyi commented on July 19, 2024

Maybe the problem fixed itself? This is what I'm seeing in trunk, and it looks about right

@ trait Direct[A] { def map[B](f: A => B): Direct[B] }; object Direct { def apply[A](xs: A*): Direct[A] = null }
defined trait Direct
defined object Direct
@ 5.
!=                  ##                  %                   &                   *
+                   -                   ->                  /                   <
<<                  <=                  ==                  >                   >=
>>                  >>>                 ResultWithoutStep   ^                   abs
asInstanceOf        byteValue           ceil                compare             compareTo
doubleValue         ensuring            eq                  equals              floatValue
floor               formatted           getClass            hashCode            intValue
isInfinite          isInfinity          isInstanceOf        isNaN               isNegInfinity
isPosInfinity       isValidByte         isValidChar         isValidInt          isValidLong
isValidShort        isWhole             longValue           max                 min
ne                  notify              notifyAll           round               self
shortValue          signum              synchronized        to                  toBinaryString
toByte              toChar              toDegrees           toDouble            toFloat
toHexString         toInt               toLong              toOctalString       toRadians
toShort             toString            unary_+             unary_-             unary_~
underlying          until               wait                |                   
@ Direct(5).
!=             ##             +              ->             ==             asInstanceOf
ensuring       eq             equals         formatted      getClass       hashCode
isInstanceOf   map            ne             notify         notifyAll      synchronized
toString       wait           
@ Direct(5).map(_.
!=                  ##                  %                   &                   *
+                   -                   ->                  /                   <
<<                  <=                  ==                  >                   >=
>>                  >>>                 ResultWithoutStep   ^                   abs
asInstanceOf        byteValue           ceil                compare             compareTo
doubleValue         ensuring            eq                  equals              floatValue
floor               formatted           getClass            hashCode            intValue
isInfinite          isInfinity          isInstanceOf        isNaN               isNegInfinity
isPosInfinity       isValidByte         isValidChar         isValidInt          isValidLong
isValidShort        isWhole             longValue           max                 min
ne                  notify              notifyAll           round               self
shortValue          signum              synchronized        to                  toBinaryString
toByte              toChar              toDegrees           toDouble            toFloat
toHexString         toInt               toLong              toOctalString       toRadians
toShort             toString            unary_+             unary_-             unary_~
underlying          until               wait                |                   
@ Seq(Direct(5)).map(_.)
!=             ##             +              ->             ==             asInstanceOf
ensuring       eq             equals         formatted      getClass       hashCode
isInstanceOf   map            ne             notify         notifyAll      synchronized
toString       wait           

from ammonite.

lihaoyi avatar lihaoyi commented on July 19, 2024

Probably need some more stuff from your repo for this to manifest, feel free to open with a self-contained example; otherwise I probably won't fix this until i bump into it myself

from ammonite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.