amnaredo / test

0 stars 0 forks source link

Unable to deal with infinite type #184

Open amnaredo opened 2 years ago

amnaredo commented 2 years ago
import upickle.default._
final case class Wrapper[X](x : X)

sealed abstract class DSL[T]
final case object DSLUnit extends DSL[Unit]
//final case class DSLWrap[T](x : DSL[T]) extends DSL[Wrapper[T]]
//final case class DSLUnWrap[T](x : DSL[Wrapper[T]]) extends DSL[T]
//either two line will cause error

object Bug {
  def x = read[DSL[Unit]](write[DSL[Unit]](DSLUnit))
}

It should work if writer and reader is generated lazily. Some compile check might be loss (since determining this is equal to halting problem)

ID: 166 Original Author: MarisaKirisame

amnaredo commented 2 years ago

Bug bankruptcy Original Author: lihaoyi