Dotty Documentation

0.11.0-bin-SNAPSHOT

object GenericSignatures
extends Object

Helper object to generate generic java signatures, as defined in the Java Virtual Machine Specification, §4.3.4

[-] Constructors

[-] Members

[+] object GenericArray
[+] private class NeedsSigCollector
[+] private object RefOrAppliedType
[+] private object ThrownException

Extracts the type of the thrown exception from an AnnotationInfo.

Supports both “old-style” @throws(classOf[Exception]) as well as “new-style” @throws[Exception]("cause") annotations.

[+] private class UnknownSig
[+] private def hiBounds ( bounds: TypeBounds ) ( implicit ctx: Context ) : List [ Type ]
[+] private def intersectionDominator ( parents: List [ Type ] ) ( implicit ctx: Context ) : Type

The intersection dominator (SLS 3.7) of a list of types is computed as follows.

  • If the list contains one or more occurrences of scala.Array with type parameters El1, El2, ... then the dominator is scala.Array with type parameter of intersectionDominator(List(El1, El2, ...)). <--- @PP: not yet in spec.
  • Otherwise, the list is reduced to a subsequence containing only types which are not subtypes of other listed types (the span.)
  • If the span is empty, the dominator is Object.
  • If the span contains a class Tc which is not a trait and which is not Object, the dominator is Tc. <--- @PP: "which is not Object" not in spec.
  • Otherwise, the dominator is the first element of the span.
[+] private def isTypeParameterInSig ( sym: Symbol , initialSymbol: Symbol ) ( implicit ctx: Context ) : Boolean
[+] def javaSig ( sym0: Symbol , info: Type ) ( implicit ctx: Context ) : Option [ String ]

Generate the signature for sym0, with type info, as defined in the Java Virtual Machine Specification, §4.3.4

[+] @noinline private final def javaSig0 ( sym0: Symbol , info: Type ) ( implicit ctx: Context ) : Option [ String ]
[+] private def minimizeParents ( cls: Symbol , parents: List [ Type ] ) ( implicit ctx: Context ) : List [ Type ]
[+] private def needsJavaSig ( tp: Type , throwsArgs: List [ Type ] ) ( implicit ctx: Context ) : Boolean
[+] private def rebindInnerClass ( pre: Type , cls: Symbol ) ( implicit ctx: Context ) : Type
[+] private def unboundedGenericArrayLevel ( tp: Type ) ( implicit ctx: Context ) : Int

Arrays despite their finality may turn up as refined type parents, e.g. with "tagged types" like Array[Int] with T.