Changeset 1764

Show
Ignore:
Timestamp:
11/14/08 05:51:49 (8 weeks ago)
Author:
Chuck.Esterbrook
Message:

Code cleanup.

Location:
cobra/trunk/Source
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/BackEndClr/SharpGenerator.cobra

    r1763 r1764  
    43274327                        if _left inherits ThisLit 
    43284328                                if _right inherits CallExpr 
    4329                                         defi = _right.memberDefinition 
    4330                                         if defi inherits IMember 
    4331                                                 writeThis = not defi.isShared 
    4332                                         else 
    4333                                                 # TODO: compiler bug stimulated by following line: 
    4334                                                 # throw FallThroughException({'right': _right, 'defi': defi}) 
    4335                                                 throw FallThroughException(defi) 
     4329                                        writeThis = not _right.memberDefinition.isShared 
    43364330                                else if _right inherits MemberExpr 
    43374331                                        writeThis = not _right.memberDefinition.isShared 
  • cobra/trunk/Source/Expr.cobra

    r1763 r1764  
    370370                DotExpr -- for _foo(args) --> ._foo(args) 
    371371                PostCallExpr 
     372 
     373        A valid call expr may have a nil .definition because the receiver is dynamic. 
    372374        """ 
    373375 
     
    377379        var _args as List<of Expr> 
    378380        var _hasParens as bool 
    379         var _definition as INamedNode?  # TODO: could tighten this down to IMember right?s 
     381        var _definition as IMember? 
    380382 
    381383        def init(token as IToken, name as String, args as List<of Expr>, hasParens as bool) 
     
    445447 
    446448                _bindImpArgs 
    447                 definition as INamedNode? 
     449                definition as IMember? 
    448450                type as IType? 
    449451 
     
    456458                                return  # TODO: I don't think I want a return here 
    457459 
    458                         definition = _inferDefinitionAndType(dotNode, definition, out type) 
     460                        definition = _inferDefinitionAndType(dotNode, out type) 
    459461                        assert type 
    460462                        if definition inherits IType    # Box, IVar or GenericParam 
     
    529531                transformTarget._transformTo(enumCall) 
    530532 
    531         def _inferDefinitionAndType(dotNode as DotExpr, definition as INamedNode?, type as out IType?) as INamedNode? 
     533        def _inferDefinitionAndType(dotNode as DotExpr, type as out IType?) as IMember? 
    532534                type = nil 
    533535                possibleDefinition = dotNode.left.memberForName(_name) 
     
    546548                        if not possibleDefinition.isCallable 
    547549                                .throwError('Cannot call "[_name]" because it is a "[possibleDefinition.englishName]".') 
    548                         definition = possibleDefinition 
     550                                 
    549551                        type = possibleDefinition.resultType 
    550                 return definition                
     552                return possibleDefinition 
    551553 
    552554        def _transformToPostCallExprOnType(dotNode, definition as IType?)