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
scala>importcoulomb.*, coulomb.syntax.*, coulomb.conversion.*, coulomb.units.si.{*, given}, coulomb.units.si.prefixes.{*, given}, algebra.instances.all.given, coulomb.ops.algebra.all.given, coulomb.policy.standard.given, scala.language.implicitConversions// works as expected
scala> summon[coulomb.ops.SimplifiedUnit[Meter^2]]
valres0:
coulomb.ops.SimplifiedUnit.NC[coulomb.units.si.Meter^2,
coulomb.units.si.Meter^2] = coulomb.ops.SimplifiedUnit$NC@5fb1d61
// works as expected (converts type literal "2" to 2)
scala> summon[coulomb.ops.SimplifiedUnit[Meter^"2"]]
valres1:
coulomb.ops.SimplifiedUnit.NC[coulomb.units.si.Meter^"2",
coulomb.units.si.Meter^2] = coulomb.ops.SimplifiedUnit$NC@cff51e5
// this should be a type error but crashes the compiler:
scala> summon[coulomb.ops.SimplifiedUnit[Meter^"x"]]
java.lang.AssertionError: assertion failed while typechecking rs$line$4
[error] java.lang.AssertionError: assertion failed
[error] at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
[error] at dotty.tools.dotc.ast.tpd$.TypeApply(tpd.scala:60)
[error] at dotty.tools.dotc.ast.tpd$TreeOps$.appliedToTypeTrees$extension(tpd.scala:985)
[error] at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4255)
...
The text was updated successfully, but these errors were encountered:
One example of a reproducer:
The text was updated successfully, but these errors were encountered: