amnaredo / test

0 stars 0 forks source link

Invalid code using upickle hangs compiler #142

Open amnaredo opened 2 years ago

amnaredo commented 2 years ago

The following invalid code causes the compilation process to hang forever.

package ru.org.codingteam.icfpc

import upickle.default._

object Serializer {

  def deserialize[T : Reader](x: String): T = {
    read[T](x)
  }
}

object MapPrinter {

  def test() : Unit = {
    val d = Serializer.deserialize("")
  }
}

Reproduced with Scala 2.11.7,

libraryDependencies ++= Seq(
  "com.lihaoyi" %% "upickle" % "0.3.4"
)

Reproducible example can be found at https://github.com/codingteam/icfpc-2015/tree/scalac-bug (exactly that branch).

It is a problem of upickle macro implementation, or should I file that to scalac bugtracker?

ID: 107 Original Author: ForNeVeR

amnaredo commented 2 years ago

I found a similar thing where I completely forgot the type argument to read which also hangs the compiler.

Original Author: jrudolph