Constant

class Constant(val value: Any, val tag: Int) extends Showable with Product1[Any]
Companion:
object
trait Product1[Any]
trait Product
trait Equals
trait Showable
class Object
trait Matchable
class Any

Value members

Concrete methods

def _1: Any
def canEqual(x: Any): Boolean
def convertTo(pt: Type)(using Context): Constant | Null

Convert constant value to conform to given type.

Convert constant value to conform to given type.

override def equals(other: Any): Boolean

We need the equals method to take account of tags as well as values.

We need the equals method to take account of tags as well as values.

Definition Classes
Equals -> Any
def get: Any
override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Returns:

the hash code value for this object.

Definition Classes
Any
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Returns:

a string representation of the object.

Definition Classes
Any
def toText(printer: Printer): Text

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

def tpe(using Context): Type

Inherited methods

def fallbackToText(printer: Printer): Text

A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

Inherited from:
Showable
override def productArity: Int
Definition Classes
Inherited from:
Product1
@throws(classOf[IndexOutOfBoundsException])
override def productElement(n: Int): Any
Definition Classes
Inherited from:
Product1
Inherited from:
Product
Inherited from:
Product
Inherited from:
Product
def show(using Context): String

The string representation of this showable element.

The string representation of this showable element.

Inherited from:
Showable
def showIndented(margin: Int)(using Context): String

The string representation with each line after the first one indented by the given given margin (in spaces).

The string representation with each line after the first one indented by the given given margin (in spaces).

Inherited from:
Showable
def showSummary(depth: Int)(using Context): String

The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

Inherited from:
Showable

Concrete fields

val tag: Int
val value: Any