Skip to content

Commit

Permalink
val/var + string interpolation example
Browse files Browse the repository at this point in the history
  • Loading branch information
jultty authored and jultty committed Nov 12, 2023
1 parent b3d079f commit 08afedb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ lazy val root = project

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test,

wartremoverErrors ++= Warts.unsafe,
wartremoverErrors ++= Warts.unsafe.filterNot(Set(
Wart.Var,
).contains),
wartremoverErrors ++= Seq(
Wart.ArrayEquals, Wart.AnyVal, Wart.Equals, Wart.ExplicitImplicitTypes,
Wart.FinalCaseClass, Wart.ImplicitConversion,
Expand Down
8 changes: 7 additions & 1 deletion src/main/scala/Main.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
@main def hello: Unit =
println("Hello, Scala")
val a_char = ','
val immutable = "Scala"
var mutable = "lo"
println(s"Hel${mutable}es$a_char $immutable!")

// ??? // throws unimplemented

// Suppresses a WartRemover warning
// @SuppressWarnings(Array("org.wartremover.warts.Var"))

// imperative
import scala.collection.mutable.ListBuffer

Expand Down

0 comments on commit 08afedb

Please sign in to comment.