Class: Jade::Frontend::TypeChecking::Expected

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authoritativeObject (readonly)

Returns the value of attribute authoritative

Returns:

  • (Object)

    the current value of authoritative



4
5
6
# File 'lib/jade/frontend/type_checking/expected.rb', line 4

def authoritative
  @authoritative
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



4
5
6
# File 'lib/jade/frontend/type_checking/expected.rb', line 4

def type
  @type
end

Class Method Details

.check(type) ⇒ Object



9
10
11
# File 'lib/jade/frontend/type_checking/expected.rb', line 9

def self.check(type)
  self[type, true]
end

.infer(type) ⇒ Object



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

def self.infer(type)
  self[type, false]
end

Instance Method Details

#check?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/jade/frontend/type_checking/expected.rb', line 5

def check?
  authoritative == true
end

#rigid_varsObject



17
18
19
# File 'lib/jade/frontend/type_checking/expected.rb', line 17

def rigid_vars
  check? ? type.unbound_vars : []
end