Constant

dotty.tools.dotc.core.Constants.Constant
See theConstant companion object
class Constant(val value: Any, val tag: Int) extends Showable, Product1[Any]

Attributes

Companion
object
Graph
Supertypes
trait Product1[Any]
trait Product
trait Equals
trait Showable
class Object
trait Matchable
class Any
Show all

Members list

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.

Attributes

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.

Attributes

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.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any
def intValue: Int
def isNaN: Boolean
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

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.

Attributes

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

Attributes

Inherited from:
Showable
override def productArity: Int

Attributes

Definition Classes
Inherited from:
Product1
override def productElement(n: Int): Any

Attributes

Definition Classes
Inherited from:
Product1

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def show(using Context): String

The string representation of this showable element.

The string representation of this showable element.

Attributes

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).

Attributes

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.

Attributes

Inherited from:
Showable

Concrete fields

val tag: Int
val value: Any