Skip to content

Instantly share code, notes, and snippets.

@Papierkorb
Created December 23, 2017 20:01
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 Papierkorb/8dac484165753b326481b9d8bdd12068 to your computer and use it in GitHub Desktop.
Save Papierkorb/8dac484165753b326481b9d8bdd12068 to your computer and use it in GitHub Desktop.
def gimme : Array(String) # <- Restricted!
Dir["*"]
end
class Foo
# vv Store it as enumerable
def initialize(@f : Enumerable(String))
end
def explode!
@f.each{ } # <- Error
end
end
# Trigger it
Foo.new(gimme).explode!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment