[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthProvider.scala:81:11: [wartremover:Var] var is disabled
[error] var _done__ = false
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:118:19: [wartremover:Any] Inferred type containing Any
[error] __fieldsMap.getOrElse(__fields.get(0), "").asInstanceOf[_root_.scala.Predef.String],
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:119:19: [wartremover:Any] Inferred type containing Any
[error] __fieldsMap.getOrElse(__fields.get(1), "").asInstanceOf[_root_.scala.Predef.String]
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:118:50: [wartremover:AsInstanceOf] asInstanceOf is disabled
[error] __fieldsMap.getOrElse(__fields.get(0), "").asInstanceOf[_root_.scala.Predef.String],
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:119:50: [wartremover:AsInstanceOf] asInstanceOf is disabled
[error] __fieldsMap.getOrElse(__fields.get(1), "").asInstanceOf[_root_.scala.Predef.String]
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:34:5: [wartremover:DefaultArguments] Function has default arguments
[error] providerId: _root_.scala.Predef.String = "",
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:71:24: [wartremover:NonUnitStatements] Statements must return Unit
[error] while (!_done__) {
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:93:35: [wartremover:Null] null is disabled
[error] if (__t != "") __t else null
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:97:35: [wartremover:Null] null is disabled
[error] if (__t != "") __t else null
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:126:62: [wartremover:OptionPartial] Option#get is disabled - use Option#fold instead
[error] __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:127:62: [wartremover:OptionPartial] Option#get is disabled - use Option#fold instead
[error] __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:129:15: [wartremover:Throw] throw is disabled
[error] case _ => throw new RuntimeException("Expected PMessage")
[error] ^
[error] C:\cygwin64\home\r892107\sourcecode\topgun\target\scala-2.12\src_managed\main\com\google\api\AuthRequirement.scala:133:113: [wartremover:Throw] throw is disabled
[error] def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
[error]
To exclude a file or directory from all checks, use wartremoverExcluded in your build.sbt file:
wartremoverExcluded += baseDirectory.value / "src" / "main" / "scala" / "SomeFile.scala"
wartremoverExcluded += sourceManaged.value
for {
...
(a,b) = foo
} yield ()
var
inside traits desugar into private fields with a setter method
StringPlusAny
StringPlusAny
, and that's not it
toString
.
StringPlusAny
feels confusing for newcomers - it's another of these failures where the root cause is hidden
+ foo +
instead of + foo.toString +
? It seems like that would be a simplification that could prevent diverging semantics – i.e., it means that interpolation and concatenation both have the same conversion semantics, rather that having interpolation do its own string conversion, which could get out of sync with that for concatenation. Since both are currently defined to use .toString
, it wouldn’t change behavior, but could change how it’s seen by WartRemover.