get block resolution to use the extra

block_compiler puts in the extra, that we get out when resolving the type
Thus block args work, though only by assuming direct call
This commit is contained in:
Torsten Ruger
2018-07-17 10:37:33 +03:00
parent 280ea8a8c4
commit ff8b95f21a
7 changed files with 36 additions and 11 deletions

View File

@ -16,6 +16,20 @@ module Risc
"#{@method.self_type.name}.init"
end
# resolve the type of the slot, by inferring from it's name, using the type
# scope related slots are resolved by the compiler by method/block
#
# This mainly calls super, and only for :caller adds extra info
# Using the info, means assuming that the block is not passed around (FIXME in 2020)
def slot_type( slot , type)
new_type = super
if slot == :caller
extra_info = { type_frame: @method.frame_type ,
type_arguments: @method.arguments_type ,
type_self: @method.self_type}
end
return new_type , extra_info
end
# determine how given name need to be accsessed.
# For blocks the options are args or frame
# or then the methods arg or frame