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

org.scalajs.junit.plugin.CompatComponent.scala Maven / Gradle / Ivy

There is a newer version: 1.17.0
Show newest version
/*
 * Scala.js (https://www.scala-js.org/)
 *
 * Copyright EPFL.
 *
 * Licensed under Apache License 2.0
 * (https://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package org.scalajs.junit.plugin

import scala.reflect.internal.Flags
import scala.tools.nsc._

/** Hacks to have our source code compatible with all the versions of scalac
 *  that we support.
 *
 *  @author Nicolas Stucki
 */
trait CompatComponent {

  val global: Global

  import global._

  implicit final class DefinitionsCompat(
      self: CompatComponent.this.global.definitions.type) {

    def wrapVarargsArrayMethodName(elemtp: Type): TermName =
      self.wrapArrayMethodName(elemtp)

    def wrapArrayMethodName(elemtp: Type): TermName = infiniteLoop()
  }

  private def infiniteLoop(): Nothing =
    throw new AssertionError("Infinite loop in Compat210Component")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy