Ticket #129 (closed defect: fixed)
Cannot use "for a, b ..." with KeyValuePair objects
Reported by: | Chuck | Owned by: | Chuck |
---|---|---|---|
Priority: | major | Milestone: | Cobra 0.9 |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | for, multi-target-assign, KeyValuePair | Cc: |
Description
This code produces error messages regarding the for loop (that won't be intelligible to the user):
class X shared def numbered as KeyValuePair<of int, String>* yield KeyValuePair<of int, String>(0, 'a') yield KeyValuePair<of int, String>(1, 'b') def main for i, s in .numbered print i, s
The error is:
x-bug-multiargassign.cobra(11): error: Cannot find an indexer in "forEnumVar5393" whose type is "KeyValuePair<of int,String>".
I'm marking as a bug since this should either work, or provide a nicer message. But what we really want is for this to work.
Also, this is required to use the upcoming IList<of T>.numbered extension method. See ticket:126
Change History
Note: See
TracTickets for help on using
tickets.