Skip to content

dotr (REPL) empty extension assertion error #8717

Closed
@kpbochenek

Description

@kpbochenek

Minimized example

scala> extension { }

Output

Exception in thread "main" java.lang.AssertionError: assertion failed
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
	at dotty.tools.dotc.util.Spans$Span$.end$extension(Spans.scala:50)
	at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:165)
	at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:229)
	at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:193)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:127)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:130)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:148)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:130)
	at dotty.tools.repl.Main$.main(Main.scala:6)
	at dotty.tools.repl.Main.main(Main.scala)

(and REPL terminates)

Expectation

Error similar to the one generated from compiler:
anonymous instance must implement a type or have at least one extension method
and REPL not terminating.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions