You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Focus on type aliases with type parameter seem to pose some problems to monocle 3.0.0.
For instance, this code
import monocle._
object Test {
case class CC[T](t: T, i: Int)
type CCInt = CC[Int]
val cc = CC(2, 3)
Focus[CCInt](_.i).get(cc)
}
Raises the following error message:
[error] -- Error: /tmp/bugmonocle/Test.scala:11:2 --------------------------------------
[error] 11 | Focus[CCInt](_.i).get(cc)
[error] | ^^^^^^^^^^^^^^^^^
[error] | method copy in class CC does not take parameters
[error] | This location contains code that was inlined from Test.scala:11
And this code:
import monocle._
object Test {
case class CC[T](t: T, i: Int)
type CCInt = CC[Int]
val cc = CC(2, 3)
Focus[CCInt](_.t).get(cc)
}
Raises this error message:
[error] -- Error: /tmp/bugmonocle/Test.scala:11:14 -------------------------------------
[error] 11 | Focus[CCInt](_.t).get(cc)
[error] | ^^^^^^^^^^^^^^^^^
[error] |Exception occurred while executing macro expansion.
[error] |java.lang.Exception: Expr cast exception: from.t
[error] |of type: from.t
[error] |did not conform to type: CC.this.T
[error] |
[error] | at scala.quoted.runtime.impl.QuotesImpl.asExprOf(QuotesImpl.scala:71)
[error] | at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExprOf(QuotesImpl.scala:113)
[error] | at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExprOf(QuotesImpl.scala:112)
[error] | at monocle.internal.focus.features.selectfield.SelectFieldGenerator.generateSelectField$$anonfun$8(SelectFieldGenerator.scala:25)
[error] | at monocle.internal.focus.features.selectfield.SelectFieldGenerator.generateSelectField$$anonfun$adapted$2(SelectFieldGenerator.scala:26)
Best,
Romain
The text was updated successfully, but these errors were encountered:
Dear Devs,
using monocle 3.0.0 and scala 3.0.1-RC2
Using Focus on type aliases with type parameter seem to pose some problems to monocle 3.0.0.
For instance, this code
Raises the following error message:
And this code:
Raises this error message:
Best,
Romain
The text was updated successfully, but these errors were encountered: