Dotty Documentation

0.14.0-bin-SNAPSHOT

class SyntheticMethods
extends Object

Synthetic method implementations for case classes, case objects, and value classes.

Selectively added to case classes/objects, unless a non-default implementation already exists: def equals(other: Any): Boolean def hashCode(): Int def canEqual(other: Any): Boolean def toString(): String def productElement(i: Int): Any def productArity: Int def productPrefix: String

Add to serializable static objects, unless an implementation already exists: private def writeReplace(): AnyRef

Selectively added to value classes, unless a non-default implementation already exists: def equals(other: Any): Boolean def hashCode(): Int

[-] Constructors

SyntheticMethods ( thisPhase: DenotTransformer )

[-] Members

[+] private var myCaseModuleSymbols : List [ Symbol ]
[+] private var myCaseSymbols : List [ Symbol ]
[+] private var myValueSymbols : List [ Symbol ]
[+] private val thisPhase : DenotTransformer
[+] def addSyntheticMethods ( impl: Template ) ( implicit ctx: Context ) : Template
[+] def caseAndValueMethods ( clazz: ClassSymbol ) ( implicit ctx: Context ) : List [ Tree ]

If this is a case or value class, return the appropriate additional methods, otherwise return nothing.

[+] def caseModuleSymbols ( implicit ctx: Context ) : List [ Symbol ]
[+] def caseSymbols ( implicit ctx: Context ) : List [ Symbol ]
[+] private def initSymbols ( implicit ctx: Context ) : Unit
[+] def serializableObjectMethod ( clazz: ClassSymbol ) ( implicit ctx: Context ) : List [ Tree ]

If this is a serializable static object Foo, add the method:

private def writeReplace(): AnyRef =
  new scala.runtime.ModuleSerializationProxy(classOf[Foo.type])

unless an implementation already exists, otherwise do nothing.

[+] def valueSymbols ( implicit ctx: Context ) : List [ Symbol ]