Skip to content

Instantly share code, notes, and snippets.

@Papierkorb
Created December 16, 2017 17:28
Demo of type inference of local variables through concurrently ran fibers
waiter = Channel(Nil).new
var = "Hello"
spawn do
waiter.receive
var = 5
end
puts "var is a #{typeof(var)}"
puts "var right now is a #{var.class}"
waiter.send(nil)
puts "var right now is a #{var.class}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment