trait NamesDefaults extends AnyRef
- Alphabetic
- By Inheritance
- NamesDefaults
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- class CaseApplyDefaultGetters extends AnyRef
- class ConstructorDefaultsAttachment extends AnyRef
- class DefaultsOfLocalMethodAttachment extends AnyRef
- case class NamedApplyInfo(qual: Option[Global.Tree], targs: List[Global.Tree], vargss: List[List[Global.Tree]], blockTyper: Analyzer.Typer, original: Global.Tree) extends Product with Serializable
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from NamesDefaults toany2stringadd[NamesDefaults] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (NamesDefaults, B)
- Implicit
- This member is added by an implicit conversion from NamesDefaults toArrowAssoc[NamesDefaults] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addDefaults(givenArgs: List[Global.Tree], qual: Option[Global.Tree], targs: List[Global.Tree], previousArgss: List[List[Global.Tree]], params: List[Global.Symbol], pos: Position, context: Analyzer.Context): (List[Global.Tree], List[Global.Symbol])
Extend the argument list
givenArgs
with default arguments.Extend the argument list
givenArgs
with default arguments. Defaults are added as named arguments calling the corresponding default getter.Returns the extended arg list and missing parameters if any.
Example: given def foo(x: Int = 2, y: String = "def") foo(y = "lt") the argument list (y = "lt") is transformed to (y = "lt", x = foo$default$1())
- def allArgsArePositional(a: Array[Int]): Boolean
returns
true
if every element is equal to its index - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def defaultGetter(param: Global.Symbol, context: Analyzer.Context): Global.Symbol
For a parameter with default argument, find the method symbol of the default getter.
- def ensuring(cond: (NamesDefaults) => Boolean, msg: => Any): NamesDefaults
- Implicit
- This member is added by an implicit conversion from NamesDefaults toEnsuring[NamesDefaults] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (NamesDefaults) => Boolean): NamesDefaults
- Implicit
- This member is added by an implicit conversion from NamesDefaults toEnsuring[NamesDefaults] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): NamesDefaults
- Implicit
- This member is added by an implicit conversion from NamesDefaults toEnsuring[NamesDefaults] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): NamesDefaults
- Implicit
- This member is added by an implicit conversion from NamesDefaults toEnsuring[NamesDefaults] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNamedArg(arg: Global.Tree): Boolean
- def makeNamedTypes(syms: List[Global.Symbol]): collection.immutable.List[Global.NamedType]
- def missingParams[T](args: List[T], params: List[Global.Symbol], argName: (T) => Option[Global.Name]): (List[Global.Symbol], Boolean)
Returns the parameter symbols of an invocation expression that are not defined by the list of arguments.
Returns the parameter symbols of an invocation expression that are not defined by the list of arguments.
- args
The list of arguments
- params
The list of parameter symbols of the invoked method
- argName
A function that extracts the name of an argument expression, if it is a named argument.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def removeNames(typer: Analyzer.Typer)(args: List[Global.Tree], params: List[Global.Symbol]): (List[Global.Tree], Array[Int])
Removes name assignments from args.
Removes name assignments from args. Additionally, returns an array mapping argument indices from call-site-order to definition-site-order.
Verifies that names are not specified twice, and positional args don't appear after named ones.
- def reorderArgs[T](args: List[T], pos: (Int) => Int)(implicit arg0: ClassTag[T]): List[T]
- pos
maps indices from old to new
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transformNamedApplication(typer: Analyzer.Typer, mode: Mode, pt: Global.Type)(tree: Global.Tree, argPos: (Int) => Int): Global.Tree
Transform a function application into a Block, and assigns typer.context .namedApplyBlockInfo to the new block as side-effect.
Transform a function application into a Block, and assigns typer.context .namedApplyBlockInfo to the new block as side-effect. If tree has the form Apply(fun, args) first the function "fun" (which might be an application itself!) is transformed into a block of the form { val qual$1 = qualifier_of_fun val x$1 = arg_1_of_fun ... val x$n = arg_n_of_fun qual$1.fun[targs](x$1, ...)...(..., x$n) } then for each argument in args, a value is created and entered into the block. finally the application expression of the block is updated. { val qual$1 = .. ... val x$n = ... > val qual$n+1 = arg(1) > ... > val qual$n+m = arg(m) > qual$1.fun[targs](x$1, ...)...(..., x$n)(x$n+1, ..., x$n+m) }
- typer
the typer calling this method; this method calls typer.doTypedApply
- mode
the mode to use for calling typer.doTypedApply
- pt
the expected type for calling typer.doTypedApply
- tree
the function application tree
- argPos
a function mapping arguments from their current position to the position specified by the method type. example: def foo(a: Int, b: String) foo(b = "1", a = 2) calls transformNamedApplication(Apply(foo, List("1", 2), { 0 => 1, 1 => 0 })
- returns
the transformed application (a Block) together with the NamedApplyInfo. if isNamedApplyBlock(tree), returns the existing context.namedApplyBlockInfo
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object NamedApplyBlock
Deprecated Value Members
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from NamesDefaults toStringFormat[NamesDefaults] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (NamesDefaults, B)
- Implicit
- This member is added by an implicit conversion from NamesDefaults toArrowAssoc[NamesDefaults] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
The Scala compiler and reflection APIs.