Changeset 2312 for cobra/trunk/Source/BinaryOpExpr.cobra
- Timestamp:
- 03/11/10 10:12:09 (2 years ago)
- Files:
-
- 1 modified
-
cobra/trunk/Source/BinaryOpExpr.cobra (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/BinaryOpExpr.cobra
r2310 r2312 804 804 (_right.right to MemberExpr).name == 'keys' and _ 805 805 _right.left.type inherits Box and _ 806 _isIDictionary(_right.left.type to Box)806 (_right.left.type to Box).isIndirectConstructionOf(.compiler.idictionaryOfType) 807 807 # then 808 808 contains = DotExpr(.token, 'DOT', _right.left, CallExpr(.token, 'containsKey', List<of Expr>([_left]), true, isImplicit=true)) … … 826 826 _needsNilCheck = true 827 827 return true 828 return false829 830 def _isIDictionary(box as Box) as bool831 if box.isGeneric832 genDef = box.genericDef833 if genDef.genericParams.count == 2 # <of TKey, TValue>834 genIDict = .compiler.idictionaryOfType835 idict = genIDict.constructedTypeFor(genDef.genericParams) to Interface836 return genDef.isDescendantOfInterface(idict)837 828 return false 838 829



