From 7c4faf7b2ad29cd28c769f72937fbadd285b1cb0 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 7 Jul 2018 17:34:48 +0300 Subject: [PATCH] fix broken test guard was green before i pushed, i swear No really --- lib/vool/block_statement.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/vool/block_statement.rb b/lib/vool/block_statement.rb index 66b8c366..8f775014 100644 --- a/lib/vool/block_statement.rb +++ b/lib/vool/block_statement.rb @@ -34,7 +34,20 @@ module Vool private def to_parfait(compiler) - + Parfait::Block.new(compiler.method.self_type , make_arg_type , make_frame) + end + def make_arg_type( ) + type_hash = {} + @args.each {|arg| type_hash[arg] = :Object } + Parfait::NamedList.type_for( type_hash ) + end + def make_frame + type_hash = {} + @body.each do |node| + next unless node.is_a?(LocalVariable) or node.is_a?(LocalAssignment) + type_hash[node.name] = :Object + end + Parfait::NamedList.type_for( type_hash ) end end