Skip to content

False "dead code" warning with throwing parameter default value #9292

Open
@scabug

Description

@scabug

With -Ywarn-dead-code :

Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45).
Type in expressions to have them evaluated.
Type :help for more information.

scala> def foo[T](v: => T = throw new Exception()): T = v
<console>:7: warning: dead code following this construct
       def foo[T](v: => T = throw new Exception()): T = v
                            ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions