amnaredo / test

0 stars 0 forks source link

Omitting type param from read method leads to 100% CPU utilization #126

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

To repro this issue, try the following in the scala console:

scala> sealed trait Building
defined trait Building

scala> case object Office extends Building
defined object Office

scala> val txt = upickle.write(Office)
txt: String = ["Office",{}]

scala> upickle.read(txt)

The symptom of the above is that when the last line is compiling, CPU goes to 100% utilization and it never executes. The workaround seems to be to always send explicit type params to the read method. If the above code is not legal, it would be nice if it didn't compile.

Note: may be related to #61 and #74, but filing as a separate issue in case it isn't.

ID: 87 Original Author: yakticus

amnaredo commented 3 years ago

Digging into it, it's the same problem as https://github.com/lihaoyi/upickle/issues/74

Original Author: lihaoyi