Wiki
Show
Ignore:
Timestamp:
02/07/08 13:16:52 (4 years ago)
Author:
chuck
Message:

Fixed: The results of a for-expression cannot be assigned back to the list variable to works on. Example: words = for word in words where word.trim.length

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Tests/240-generics/100-use-generics-collections/610-for-expr-generic-list.cobra

    r1244 r1264  
    4242 
    4343        # where with a non bool-typed expression 
    44         stuff = 'aoeu   aoeu' 
     44        stuff = 'aoeu   asdf' 
    4545        words = for rawWord in stuff.split where rawWord.trim.length get rawWord.trim 
    46         assert words == ['aoeu', 'aoeu'] 
     46        assert words == ['aoeu', 'asdf'] 
     47        words = for word in words where word <> 'asdf'   # assign for expr back to source variable 
     48        assert words == ['aoeu']