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
ToolBox.typecheck fails an assertion with the message "import failure: cannot determine unique overloaded method alternative from..." when typechecking an overridden interface method.
importscala.reflect.runtime.currentMirrorimportscala.tools.reflect.ToolBoxvaltoolBox= currentMirror.mkToolBox()
// the expression prints fine in scala/scalac
println(java.time.Instant.now().plus(24, java.time.temporal.ChronoUnit.HOURS))
valtree= toolBox.parse(""" java.time.Instant.now().plus(24, java.time.temporal.ChronoUnit.HOURS)""")
toolBox.typecheck(tree) // throws AssertionError
Stack trace:
java.lang.AssertionError: assertion failed: import failure: cannot determine unique overloaded method alternative from
def plus(x$1: Long,x$2: java.time.temporal.TemporalUnit): java.time.temporal.Temporal
def plus(x$1: Long,x$2: java.time.temporal.TemporalUnit): java.time.Instant
that matches method plus:(x$1: Long, x$2: java.time.temporal.TemporalUnit)java.time.Instant
at scala.reflect.internal.Importers$StandardImporter.disambiguate$1(Importers.scala:183)
at scala.reflect.internal.Importers$StandardImporter.recreateOrRelink$1(Importers.scala:188)
at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:210)
at scala.reflect.internal.Importers$StandardImporter.recreatedTreeCompleter(Importers.scala:298)
at scala.reflect.internal.Importers$StandardImporter.$anonfun$importTree$1(Importers.scala:417)
at scala.reflect.internal.Importers$StandardImporter.tryFixup(Importers.scala:49)
at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:418)
at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:374)
at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:415)
at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:29)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.$anonfun$typecheck$6(ToolBoxFactory.scala:380)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.apply(ToolBoxFactory.scala:359)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.typecheck(ToolBoxFactory.scala:371)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.typecheck(ToolBoxFactory.scala:26)
... 29 elided
Thanks for reading!
The text was updated successfully, but these errors were encountered:
ToolBox.typecheck fails an assertion with the message "import failure: cannot determine unique overloaded method alternative from..." when typechecking an overridden interface method.
Stack trace:
Thanks for reading!
The text was updated successfully, but these errors were encountered: