Skip to content

2.12 reports parser warnings twice #12354

@lrytz

Description

@lrytz

In Scala 2.12.13, parser warnings are reported twice, or even trice. Typer warnings once.

scala> case class C(implicit x: Int)
<console>:1: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)'
case class C(implicit x: Int)
            ^
<console>:11: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)'
case class C(implicit x: Int)
            ^
defined class C

scala> for {x <- Nil; val y = 1} yield y
<console>:1: warning: val keyword in for comprehension is deprecated
for {x <- Nil; val y = 1} yield y
                     ^
<console>:2: warning: val keyword in for comprehension is deprecated
for {x <- Nil; val y = 1} yield y
                     ^
<console>:12: warning: val keyword in for comprehension is deprecated
for {x <- Nil; val y = 1} yield y
                     ^
res0: List[Int] = List()

scala> try 1
<console>:12: warning: A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled.
try 1
^
res1: Int = 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions