Class: Steep::AST::Types::Any

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/ast/types/any.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location: nil) ⇒ Any

Returns a new instance of Any.



7
8
9
# File 'lib/steep/ast/types/any.rb', line 7

def initialize(location: nil)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/steep/ast/types/any.rb', line 5

def location
  @location
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



11
12
13
# File 'lib/steep/ast/types/any.rb', line 11

def ==(other)
  other.is_a?(Any)
end

#free_variablesObject



29
30
31
# File 'lib/steep/ast/types/any.rb', line 29

def free_variables
  Set.new
end

#hashObject



15
16
17
# File 'lib/steep/ast/types/any.rb', line 15

def hash
  self.class.hash
end

#levelObject



33
34
35
# File 'lib/steep/ast/types/any.rb', line 33

def level
  [1]
end

#subst(s) ⇒ Object



21
22
23
# File 'lib/steep/ast/types/any.rb', line 21

def subst(s)
  self
end

#to_sObject



25
26
27
# File 'lib/steep/ast/types/any.rb', line 25

def to_s
  "untyped"
end

#with_location(new_location) ⇒ Object



37
38
39
# File 'lib/steep/ast/types/any.rb', line 37

def with_location(new_location)
  self.class.new(location: new_location)
end