TypeApplyMethods

Extension methods of TypeApply

Source:
Quotes.scala

Extensions

Extensions

extension (self: TypeApply)

The (inferred) type arguments passed to the method

The (inferred) type arguments passed to the method

The TypeApply may be a partially applied method:

package scala.quoted
trait Snippet0 { self: runtime.QuoteUnpickler & scala.quoted.runtime.QuoteMatching &    scala.quoted.Quotes =>
  val QuoteUnpickler = self
  val QuoteMatching = self
  val Quotes = self
  trait Snippet1 { self: Quotes.reflect.type /*Quotes.reflectModule*/ &    Quotes.reflectModule =>
    val reflect = self
    val reflectModule = self
    trait Snippet2 { self: reflectModule.TypeApplyMethods =>
      val TypeApplyMethods = self
      type T
      extension (x: Int) def f[T](y: T) = ???
      // represented as
      // def f(x: Int)[T](y: T) = ???
      
      1.f[Int](2)
      // represented as
      // f(1)[Int](2)
    }
  }
}
  • fun is [Int] in the TypeApply of f(1)[Int]
Source:
Quotes.scala
def fun: Term

The fun part of an (inferred) type application like fun[Args]

The fun part of an (inferred) type application like fun[Args]

It may be a partially applied method:

package scala.quoted
trait Snippet0 { self: runtime.QuoteUnpickler & scala.quoted.runtime.QuoteMatching &    scala.quoted.Quotes =>
  val QuoteUnpickler = self
  val QuoteMatching = self
  val Quotes = self
  trait Snippet1 { self: Quotes.reflect.type /*Quotes.reflectModule*/ &    Quotes.reflectModule =>
    val reflect = self
    val reflectModule = self
    trait Snippet2 { self: reflectModule.TypeApplyMethods =>
      val TypeApplyMethods = self
      type T
      extension (x: Int) def f[T](y: T) = ???
      // represented as
      // def f(x: Int)[T](y: T) = ???
      
      1.f[Int](2)
      // represented as
      // f(1)[Int](2)
    }
  }
}
  • fun is f(1) in the TypeApply of f(1)[Int]
Source:
Quotes.scala