fix class def tests and code

This commit is contained in:
Torsten Ruger
2016-12-10 22:41:49 +02:00
parent aa5641a29b
commit e82c86f6c1
2 changed files with 38 additions and 34 deletions

View File

@ -9,7 +9,8 @@ module Typed
index = for_class.instance_type.variable_index(statement.name)
raise "class field already defined:#{name} for class #{for_class.name}" if index
for_class.instance_type.add_instance_variable( statement.name , statement.type )
#FIXME should not hack into current type, but create a new
for_class.instance_type.send(:private_add_instance_variable, statement.name , statement.type)
return nil # statements don't reurn values, only expressions
end