diff --git a/lib/dhallish.rb b/lib/dhallish.rb index 6e6248be29cd9179ccffc00a5b6c512b30237344..1e15e1fda8529d33c1845fe2486c6252d23f32b6 100644 --- a/lib/dhallish.rb +++ b/lib/dhallish.rb @@ -31,7 +31,8 @@ module Dhallish end ast = treetopast.to_node nil - ast.compute_type typectx + type = ast.compute_type typectx + puts type return ast.evaluate ctx end diff --git a/lib/types.rb b/lib/types.rb index 587b1ff3929d599bcb808485f2bf0396485ac6cf..fe558f0245c36ab8d590c1ed89fa74733dc04182 100644 --- a/lib/types.rb +++ b/lib/types.rb @@ -135,10 +135,12 @@ module Dhallish Function.new(resolve(orgtype.argtype, name, newtype), nil, orgtype.unres) else restype = orgtype.restype + argtype = orgtype.argtype if orgtype.unres.nil? or orgtype.unres != name restype = resolve(orgtype.restype, name, newtype) + argtype = resolve(orgtype.argtype, name, newtype) end - Function.new(resolve(orgtype.argtype, name, newtype), restype, orgtype.unres) + Function.new(argtype, restype, orgtype.unres) end when Optional Optional.new(resolve(orgtype.type, name, newtype))