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

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

The newest version!
package org.wartremover
package warts

object SeqApply 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("apply")) if left.tpe.baseType(symbol) != NoType =>
            error(u)(tree.pos, "Seq.apply is disabled")
            super.traverse(tree)
          case _ =>
            super.traverse(tree)
        }
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy