These are chat archives for fthomas/refined

19th
Jun 2016
Frank S. Thomas
@fthomas
Jun 19 2016 19:21

@milessabin Here is another issue I found:

scala> scala.reflect.runtime.universe.reify(1)
res3: reflect.runtime.universe.Expr[Int] = Expr[Int(1)](1)

scala> scala.reflect.runtime.universe.reify(1: 1)
<console>:12: error: exception during macro expansion:
java.lang.Error: internal error: 1 (LiteralType) is not supported
    at scala.reflect.reify.codegen.GenTypes.reifyToughType(GenTypes.scala:192)

This will probably go away when LiteralType is replaced with ConstantType, but I wanted to mention it anyway.

Frank S. Thomas
@fthomas
Jun 19 2016 21:59
I also tried to debug the foo(y) == 0 issue and found that mkCast generates a cast of this form $iw.this.foo($iw.this.y()).$asInstanceOf[Int(1)](). I think it is worth checking if this one actually succeeds