Skip to content

Commit

Permalink
Enable -Werror for compiler build
Browse files Browse the repository at this point in the history
  • Loading branch information
NthPortal authored and dwijnand committed Oct 23, 2020
1 parent c9b79e7 commit 0343756
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ lazy val compiler = configureAsSubproject(project)
.settings(generateBuildCharacterFileSettings)
.settings(Osgi.settings)
.settings(AutomaticModuleName.settings("scala.tools.nsc"))
.settings(fatalWarningsSettings)
.settings(
name := "scala-compiler",
description := "Scala Compiler",
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ trait Implicits {
private def dominates(dtor: Type, dted: Type): Boolean = {
@annotation.tailrec def sumComplexity(acc: Int, xs: List[Type]): Int = xs match {
case h :: t => sumComplexity(acc + complexity(h), t)
case _: Nil.type => acc
case _ => acc
}

def complexity(tp: Type): Int = tp.dealias match {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ abstract class RefChecks extends Transform {
}
val receiver = underlyingClass(qual.tpe)
val actual = underlyingClass(other.tpe)
def typesString = normalizeAll(qual.tpe.widen)+" and "+normalizeAll(other.tpe.widen)
def typesString = s"${normalizeAll(qual.tpe.widen)} and ${normalizeAll(other.tpe.widen)}"
def nonSensiblyEquals() = {
refchecksWarning(pos, s"comparing values of types $typesString using `${name.decode}` is unsafe due to cooperative equality; use `==` instead", WarningCategory.OtherNonCooperativeEquals)
}
Expand Down

0 comments on commit 0343756

Please sign in to comment.