Skip to content

Instantly share code, notes, and snippets.

@realjenius
Created November 24, 2011 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save realjenius/1391899 to your computer and use it in GitHub Desktop.
Save realjenius/1391899 to your computer and use it in GitHub Desktop.
Type resolve
class Typer
def resolve
old_len = @deferred_nodes.length
while true
@deferred_nodes.each do |node|
type = infer(node)
if type != nil
@deferred_nodes.remove(node)
end
end
if @deferred_nodes.length == 0
break
elsif old_len == @deferred_nodes.length
raise # can't infer error!
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment