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

dotty.tools.package.scala Maven / Gradle / Ivy

package dotty
import scala.annotation.Annotation

package object tools {
  class sharable extends Annotation
  class unshared extends Annotation

  // Ensure this object is already classloaded, since it's only actually used
  // when handling stack overflows and every operation (including class loading)
  // risks failing.
  dotty.tools.dotc.core.handleRecursive

  val ListOfNil = Nil :: Nil

  /** True if two lists have the same length.  Since calling length on linear sequences
   *  is O(n), it is an inadvisable way to test length equality.
   */
  final def sameLength[T](xs: List[T], ys: List[T]): Boolean = xs match {
    case _ :: xs1 =>
      ys match {
        case _ :: ys1 => sameLength(xs1, ys1)
        case _ => false
      }
    case _ => ys.isEmpty
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy