Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.