All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wartremover.warts.SeqUpdated.scala Maven / Gradle / Ivy

There is a newer version: 3.2.4
Show newest version
package org.wartremover
package warts

object SeqUpdated extends WartTraverser {
  override def apply(u: WartUniverse): u.Traverser = {
    import u.universe._
    val symbol = rootMirror.staticClass("scala.collection.Seq")
    new u.Traverser {
      override def traverse(tree: Tree): Unit = {
        tree match {
          case _ if hasWartAnnotation(u)(tree) =>
          case Select(left, TermName("updated")) if left.tpe.baseType(symbol) != NoType =>
            error(u)(tree.pos, "Seq.updated is disabled")
            super.traverse(tree)
          case _ =>
            super.traverse(tree)
        }
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy