Skip to content

Default Initializer + intersection with Nothing = CCE #10732

@sir-wabbit

Description

@sir-wabbit
scala> val a : Int with Nothing = a
                                  ^
       warning: value a does nothing other than call itself recursively
a: Int with Nothing = 0

scala> val b : Nothing = a
java.lang.ClassCastException: java.lang.Integer cannot be cast to scala.runtime.Nothing$
  ... 40 elided

Tested in 2.13.0-M3 REPL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions