Module: TypeProf::Core::TypeAliasRead

Included in:
BaseTypeAliasRead, ScopedTypeAliasRead
Defined in:
lib/typeprof/core/env/static_read.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#type_alias_entityObject (readonly)

Returns the value of attribute type_alias_entity.



145
146
147
# File 'lib/typeprof/core/env/static_read.rb', line 145

def type_alias_entity
  @type_alias_entity
end

Instance Method Details

#check_module(genv, mod) ⇒ Object



125
126
127
128
129
130
131
132
# File 'lib/typeprof/core/env/static_read.rb', line 125

def check_module(genv, mod)
  tae = mod.type_aliases[@name]
  if tae && tae.exist?
    update_type_alias(genv, tae)
    return true
  end
  return false
end

#resolution_failed(genv) ⇒ Object



134
135
136
# File 'lib/typeprof/core/env/static_read.rb', line 134

def resolution_failed(genv)
  update_type_alias(genv, nil)
end

#update_type_alias(genv, tae) ⇒ Object



138
139
140
141
142
143
# File 'lib/typeprof/core/env/static_read.rb', line 138

def update_type_alias(genv, tae)
  if tae != @type_alias_entity
    @type_alias_entity = tae
    propagate(genv)
  end
end