Scalafix

Scalafix

  • User guide
  • Developer guide
  • Browse sources
  • GitHub

›Rules

Usage

  • Installation
  • Configuration
  • Suppressing rules

Rules

  • All rules
  • RemoveUnused
  • DisableSyntax
  • NoAutoTupling
  • LeakingImplicitClassVal
  • NoValInForComprehension
  • ProcedureSyntax

Misc

  • Related projects
Edit

NoValInForComprehension

Removes val from definitions in for-comprehension:

// before
for {
  n <- List(1, 2, 3)
  val inc = n + 1
} yield inc
// after
for {
  n <- List(1, 2, 3)
  inc = n + 1
} yield inc

The two syntaxes are equivalent and the presence of the val keyword has been deprecated since Scala 2.10.

← PreviousNext →
Scalafix
Docs
Get startedRulesExtend Scalafix
Community
Chat on GitterDiscuss on Scala Users
More
GitHub
Copyright © 2018 Scala Center