fix more expression tests

This commit is contained in:
Torsten Ruger
2016-12-10 15:18:37 +02:00
parent 98bc0f6e40
commit 4054b61752
7 changed files with 31 additions and 46 deletions

View File

@ -8,7 +8,7 @@ module Typed
clazz = Register.machine.space.get_class_by_name receiver.type
field_name = statement.field.name
index = clazz.instance_type.variable_index(field_name)
raise "field access, but no such field:#{field_name} for class #{clazz.name}" unless index
raise "no such field:#{field_name} for class #{clazz.name}:#{clazz.instance_type.inspect}" unless index
value = use_reg(clazz.instance_type.type_at(index))
add_code Register.get_slot(statement , receiver , index, value)

View File

@ -23,7 +23,7 @@ module Typed
private
def handle_local statement
index = @method.has_local( name )
index = @method.has_local( statement.name )
raise "must define variable '#{name}' before using it" unless index
frame = use_reg :Frame
add_code Register.get_slot(statement , :message , :frame , frame )