Skip to content

Casting to Unit #5791

Closed
Closed
@allanrenucci

Description

@allanrenucci

With Scala 2:

scala> "Hello".asInstanceOf[Unit]
// OK, nothing happens

With Dotty:

scala> "Hello".asInstanceOf[Unit]                                                                                                                                                                               
java.lang.ClassCastException: java.lang.String cannot be cast to scala.runtime.BoxedUnit

What is the right behavior?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions