Skip to content

Compile shows weird message: assertion failed: asTerm called on not-a-Term val <none> #17556

Closed
@lenguyenthanh

Description

@lenguyenthanh

Compiler version

I tested on 3.2.2, 3.3.0-RC6 and 3.nightly

Minimized code

//> using scala 3.2.2

trait FromString[A]:
  def parse(s: String): Either[String, A]

sealed trait Uci:

  case class Move(from: String, to: String) extends Uci

object Uci extends FromString[Uci]:
	def parse(s: String): Either[String, Uci] = ???

or in scastie

Output (click arrow to expand)

Compiling project (Scala 3.2.2, JVM) exception occurred while compiling /Users/tle/git/lichess/scripts/DottyBroke.scala Error compiling project (Scala 3.2.2, JVM) Error: Unexpected error when compiling project_ed944f97cf-10493a1c22: 'assertion failed: asTerm called on not-a-Term val ' Compilation failed

Expect

I expect a better error message.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions