Changeset 1710
- Timestamp:
- 10/27/08 22:45:57 (2 months ago)
- Location:
- cobra/trunk
- Files:
-
- 1 added
- 4 modified
-
Developer/IntermediateReleaseNotes.text (modified) (1 diff)
-
Source/Boxes.cobra (modified) (1 diff)
-
Source/Compiler.cobra (modified) (1 diff)
-
Tests/320-misc-two/810-multi-assignment/220-multi-arg-for-dict.cobra (modified) (1 diff)
-
Tests/400-misc-bugs/220-infer-hashtable-enumerator.cobra (added)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Developer/IntermediateReleaseNotes.text
r1704 r1710 176 176 177 177 * Fixed: Reading enums with non-int32 storage types (such as uint32 and uint64) causes an exception in the compiler. 178 179 * Fixed: A `for` statement iterating over a Hashtable doesn't infer the enumerator type correctly (DictionaryEntry). ticket:54 -
cobra/trunk/Source/Boxes.cobra
r1709 r1710 438 438 return rt 439 439 else 440 if rt.isDescendantOf(.compiler.dictEnumeratorType) 441 return rt.memberForName('entry').resultType 440 442 if rt.isDescendantOf(.compiler.enumeratorType) 441 443 return rt.memberForName('current').resultType -
cobra/trunk/Source/Compiler.cobra
r1704 r1710 1228 1228 return _libraryBox('System.Collections.Generic.IEnumerator<of>') 1229 1229 1230 def dictEnumeratorType as Box 1231 return _libraryBox('System.Collections.IDictionaryEnumerator') 1232 1230 1233 def collectionType as Box 1231 1234 return _libraryBox('System.Collections.ICollection') -
cobra/trunk/Tests/320-misc-two/810-multi-assignment/220-multi-arg-for-dict.cobra
r1705 r1710 77 77 assert gdict['a'] == 'z' 78 78 79 for dev in gdict 80 de = dev to DictionaryEntry # necessary casting 79 for de in gdict 81 80 k, v = [de.key, de.value] 82 81 assert k in ['a', 'b', 'c'] 83 82 assert v in ['z', 'y', 'w'] 84 83 85 # this not work till HashTable enumerator type inference implemented 86 /# for k, v in gdict 84 for k, v in gdict 87 85 assert k in ['a', 'b', 'c'] 88 86 assert v in ['z', 'y', 'w'] 89 #/87
