Skip to content

Instantly share code, notes, and snippets.

@aturley
Created March 10, 2016 15:10
Show Gist options
  • Save aturley/ae2bf5edefa44af8d758 to your computer and use it in GitHub Desktop.
Save aturley/ae2bf5edefa44af8d758 to your computer and use it in GitHub Desktop.
let lit = [(lambda(s:String): String ref => String().append(s) end, lambda(s:String): String ref => String().append(s) end),
(lambda(s:String): String ref => String().append(s).append(s) end, lambda(s:String): String ref => String().append(s).append(s) end),
(lambda(s:String): String ref => String().append(s).append(s).append(s) end, lambda(s:String): String ref => String().append(s).append(s).append(s) end)]
var result = String()
for (la, lb) in lit.values() do
result = result.append(la("a")).append(lb("b"))
end
Error:
/Users/aturley/development/pony-bugs/types-in-literals/tests.pony:63:9: can't destructure a union using assignment, use pattern matching instead
for (la, lb) in lit.values() do
^
Error:
/Users/aturley/development/pony-bugs/types-in-literals/tests.pony:58:71: right side type: (($1$6 val, $1$7 val) | ($1$8 val, $1$9 val) | ($1$10 val, $1$11 val))
let lit = [(lambda(s:String): String ref => String().append(s) end, lambda(s:String): String ref => String().append(s) end),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment