Changeset 1607
- Timestamp:
- 08/28/08 15:11:33 (3 months ago)
- Files:
-
- 1 modified
-
cobra/trunk/Source/Members.cobra (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Members.cobra
r1606 r1607 229 229 230 230 def bindImp as dynamic 231 if not .parentBox.isConstructed 232 return base.bindImp 233 else 234 # TODO: shouldn't even get this message in the first place. investigate. 235 return .bindImpResult 231 assert not .parentBox.isConstructed 232 return base.bindImp 236 233 237 234 def _bindImp is override 238 235 base._bindImp 239 236 assert .didBindInt # class members should have always received a bindInt first 240 # TODO: assert not .parentBox.isConstructed # not expecting to bindImp on a constructed type 241 for attrib in _attribs 242 attrib.bindImp 243 if _testMethod 244 _testMethod.bindImp 237 assert not .parentBox.isConstructed # not expecting to bindImp on a constructed type 238 for attrib in _attribs, attrib.bindImp 239 if _testMethod, _testMethod.bindImp 245 240 246 241 def usesBase … … 250 245 # using base implies override, but only if the method sig in the base class is the same 251 246 # (otherwise it's just an overload) 252 parentBox = _parentBox 253 if parentBox inherits Class 247 if (parentBox = .parentBox) inherits Class 254 248 assert parentBox.baseClass 255 249 # Why not use .matchingBaseMember? Because currently that's only method-to-method. Does not work for properties. … … 548 542 """ 549 543 t = .type 550 if t 551 return t 552 else 553 throw FallThroughException('_type is nil. this=[this]') 544 if t, return t 545 else, throw FallThroughException('_type is nil. this=[this]') 554 546 555 547 def constructedFor(box as Box, gpToType as Dictionary<of GenericParam, IType>) as BoxMember # CC: as same 556 # TODO: require .type (or assert)548 assert .type 557 549 newMember = base.constructedFor(box, gpToType) to BoxVar # CC: this = base. ... 558 550 assert newMember._type … … 687 679 def findLocal(name as String) as AbstractLocalVar? 688 680 # TODO: should this use a dictionary lookup? 689 for local in _locals 690 if local.name==name 691 return local 692 for param in _params 693 if param.name==name 694 return param 681 for local in _locals, if local.name==name, return local 682 for param in _params, if param.name==name, return param 695 683 return nil 696 684 … … 698 686 name = name.toLower 699 687 # TODO: should this use a dictionary lookup? 700 for local in _locals 701 if local.name.toLower==name 702 return local 703 for param in _params 704 if param.name.toLower==name 705 return param 688 for local in _locals, if local.name.toLower==name, return local 689 for param in _params, if param.name.toLower==name, return param 706 690 return nil 707 691 … … 851 835 if _matchingBaseMember, return 852 836 if not .canHaveMatchingBaseMember, return 853 parentBox = .parentBox 854 if parentBox inherits Class 837 if (parentBox = .parentBox) inherits Class 855 838 if parentBox.baseClass 856 839 baseMember = parentBox.baseClass.memberForName(_name) … … 1243 1226 _returnTypeNode = returnTypeNode 1244 1227 _implementsTypeNode = implementsTypeNode 1245 # TODO: feels kind of hacky:1246 1228 if 'virtual' in _isNames and _implementsTypeNode 1247 1229 _isNames.remove('virtual')
