Class: Jade::Frontend::TypeChecking::Unification::Context

Inherits:
Data
  • Object
show all
Defined in:
lib/jade/frontend/type_checking/unification.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rigid_varsObject (readonly)

Returns the value of attribute rigid_vars

Returns:

  • (Object)

    the current value of rigid_vars



7
8
9
# File 'lib/jade/frontend/type_checking/unification.rb', line 7

def rigid_vars
  @rigid_vars
end

Class Method Details

.emptyObject



8
9
10
# File 'lib/jade/frontend/type_checking/unification.rb', line 8

def self.empty
  new([])
end

Instance Method Details

#rigid?(type) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/jade/frontend/type_checking/unification.rb', line 12

def rigid?(type)
  rigid_ids = rigid_vars.map(&:id).to_set
  type.unbound_vars.any? { rigid_ids.include?(it.id) }
end