Class: TypedRb::Model::TmSelf

Inherits:
Expr show all
Defined in:
lib/typed/model/tm_self.rb

Overview

booleans

Instance Attribute Summary

Attributes inherited from Expr

#col, #line, #node, #type

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ TmSelf

Returns a new instance of TmSelf.



8
9
10
# File 'lib/typed/model/tm_self.rb', line 8

def initialize(node)
  super(node)
end

Instance Method Details

#check_type(context) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/typed/model/tm_self.rb', line 12

def check_type(context)
  self_type = context.get_type_for(:self)
  if self_type.nil?
    fail TypeCheckError.new.new('Error type checking self reference: Cannot find self reference in typing context', node)
  else
    self_type
  end
end