amnaredo / test

0 stars 0 forks source link

Any/Nothing kills compiler #116

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

While playing with this stuff, I did something, which naturally does not work, but the issue is that it also kills the compiler . It's very simple to isolate:

build.sbt:-----------------
scalaVersion := "2.11.5"
libraryDependencies += "com.lihaoyi" %% "upickle" % "0.2.6"
------------------------------
object T {
  def foo(a:Any):String = {
    upickle.write(a)
  }
}
------------------------------

If I change it to foo(a:AnyRef), I get "Don't know how to pickle AnyRef; it's companion has no apply method", which is sensible, but with a:Any, the compiler churns forever.

ID: 74 Original Author: joss75321

amnaredo commented 3 years ago

Turns out that Any somehow gets passed to the macro as Nothing (???) and causes the same problem. It's some weird interaction with the implicits which causes this...

Original Author: lihaoyi

amnaredo commented 3 years ago

Fixed in master; it continues to loop forever, but now at least it makes noise when it does so

Original Author: lihaoyi