Changeset 2307 for cobra/trunk/Source/Statements.cobra
- Timestamp:
- 03/10/10 08:30:47 (2 years ago)
- Files:
-
- 1 modified
-
cobra/trunk/Source/Statements.cobra (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Statements.cobra
r2300 r2307 591 591 isStreamOfKeyValue = .what.type.isDictionaryLike 592 592 if not isStreamOfKeyValue and _var.type inherits Box 593 isStreamOfKeyValue = (_var.type to Box).is ConstructionOf(.compiler.libraryType('System.Collections.Generic.KeyValuePair<of,>') to Box)593 isStreamOfKeyValue = (_var.type to Box).isIndirectConstructionOf(.compiler.libraryType('System.Collections.Generic.KeyValuePair<of,>') to Box) 594 594 if isStreamOfKeyValue 595 595 # This covers: … … 1462 1462 resultType = curCodeMember.resultType 1463 1463 if not resultType inherits StreamType and resultType <> .compiler.enumerableType and resultType <> .compiler.enumeratorType 1464 okay = false1464 bad = true 1465 1465 if resultType inherits Box 1466 1466 ienumerableOf = .compiler.enumerableOfType 1467 1467 ienumeratorOf = .compiler.enumeratorOfType 1468 okay = not (resultType is not ienumerableOf and resultType is not ienumeratorOf and not resultType.isConstructionOf(ienumerableOf) and not resultType.isConstructionOf(ienumeratorOf)) 1469 if not okay 1470 .throwError('Cannot yield unless the return type is an iterator type. Try "[expr.type.name]*".') 1468 bad = resultType is not ienumerableOf and resultType is not ienumeratorOf and not resultType.isDirectConstructionOf(ienumerableOf) and not resultType.isDirectConstructionOf(ienumeratorOf) 1469 if bad, .throwError('Cannot yield unless the return type is an iterator type. Try "[expr.type.name]*".') 1471 1470 if resultType inherits StreamType 1472 1471 elementType = resultType.innerType to !



