Skip to content

Missing pure expression in statement position warning #5013

Closed
@nicolasstucki

Description

@nicolasstucki
class Foo {
  def foo: Unit = 3
}

Does not complain in Dotty.

But in scalac

Foo.scala:4: warning: a pure expression does nothing in statement position
  def foo: Unit = 3
                  ^
one warning found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions