amnaredo / test

0 stars 0 forks source link

Regression from 0.2 - implementation restriction error for implicit constructor param #143

Open amnaredo opened 2 years ago

amnaredo commented 2 years ago

Here's a piece of code that compiles fine with 0.2.8 but fails to compile in 0.3.5:

import upickle.default._ // or `import upickle._` for 0.2.8

case class Stuff(lol: String)
case class Wat(stuff: Stuff)

abstract class TakesWriter[T: Writer]
class Something extends TakesWriter[Wat]

Result:

error: Implementation restriction: access of value derive$macro$2$1 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class Something
  class Something extends TakesWriter[Wat]
                          ^

ID: 108 Original Author: ghik

amnaredo commented 2 years ago

This appears to be a case of https://issues.scala-lang.org/browse/SI-8775

Original Author: lihaoyi