Skip to content

class Crystal::NumberLiteralType
inherits Crystal::LiteralType

Type for a number literal: it has the specific type of the number literal but can also match other types (like ints and floats) if the literal fits in those types.

Class methods

.new(program, literal)

View source

Methods

#compatible_with?(type)

View source

#literal : NumberLiteral

The literal associated with this type

View source

#restrict(other, context)

View source

#to_s_with_options(io : IO, skip_union_parens : Bool = false, generic_args : Bool = true, codegen : Bool = false) : Nil

View source