Created
March 10, 2016 15:10
-
-
Save aturley/ae2bf5edefa44af8d758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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