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
import org.scalatest.funspec.AnyFunSpec
import scala.language.experimental.macros
class ErrorCase extends AnyFunSpec {
final val code = """
object FoundReq {
class L
type R
def f(r: R): Int = ???
f(new L)
}"""
val aa = utest.compileError(
code
)
}
This generates the error:
[Error] /home/..../ErrorCase.scala:19:30: exception during macro expansion:
java.lang.ArrayIndexOutOfBoundsException: 26
at scala.reflect.internal.util.BatchSourceFile.findLine$1(SourceFile.scala:218)
at scala.reflect.internal.util.BatchSourceFile.offsetToLine(SourceFile.scala:221)
at scala.reflect.internal.util.InternalPositionImpl.line0(Position.scala:177)
at scala.reflect.internal.util.InternalPositionImpl.lineContent(Position.scala:189)
at scala.reflect.internal.util.InternalPositionImpl.lineContent$(Position.scala:189)
at scala.reflect.internal.util.Position.lineContent(Position.scala:19)
at utest.asserts.AssertsCompanionVersionSpecific.calcPosMsg$1(Asserts.scala:27)
at utest.asserts.AssertsCompanionVersionSpecific.compileError(Asserts.scala:82)
at utest.asserts.AssertsCompanionVersionSpecific.compileError$(Asserts.scala:21)
at utest.asserts.Asserts$.compileError(Asserts.scala:15)
The text was updated successfully, but these errors were encountered:
Simple demonstration:
This generates the error:
The text was updated successfully, but these errors were encountered: