Wiki

Changeset 2297

Show
Ignore:
Timestamp:
03/01/10 05:31:47 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Fixed: The expression SomeNameSpace.SomeClass().someMethod does not invoke someMethod.

Location:
cobra/trunk
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/BinaryOpExpr.cobra

    r2231 r2297  
    635635            _dotRightExpr = right to IDotRightExpr 
    636636 
     637    def addMinFields 
     638        base.addMinFields 
     639        .addField('left.toCobraSource', .safeLeftToCobraSource) 
     640        .addField('right.toCobraSource', .safeRightToCobraSource) 
     641 
     642    def safeLeftToCobraSource as String 
     643        try 
     644            return .left.toCobraSource 
     645        catch exc as Exception 
     646            return exc.toString 
     647     
     648    def safeRightToCobraSource as String 
     649        try 
     650            return .right.toCobraSource 
     651        catch exc as Exception 
     652            return exc.toString 
     653 
    637654    get definition is override 
    638655        """ 
  • cobra/trunk/Source/Expr.cobra

    r2287 r2297  
    581581            assert type 
    582582            if definition inherits IType    # Box, IVar or GenericParam 
    583                 _transformToPostCallExprOnType(dotNode, definition) 
     583                _transformToPostCallExprOnType(definition) 
    584584                return 
    585585 
     
    678678        return possibleDefinition 
    679679 
    680     def _transformToPostCallExprOnType(dotNode, definition as IType?) 
    681         # for Foo.Bar() where Bar is a box/type 
    682         # Change to a PostCallExpr on the type 'Foo.Bar' 
    683              
    684         # Roll up Foo.Bar.Baz() into one PostCallExpr 
    685         transformTarget = dotNode 
    686         while transformTarget.superNode inherits DotExpr 
    687             transformTarget = transformTarget.superNode to DotExpr 
    688  
    689         postCall = PostCallExpr(.token, TypeExpr(.token, definition), .args).bindImp 
    690         _type = postCall.type to IType 
     680    def _transformToPostCallExprOnType(definition as IType?) 
     681        transformTarget = .superNode to DotExpr 
     682        postCall = PostCallExpr(.token, TypeExpr(.token, definition), .args).bindAll to PostCallExpr 
     683        _type = postCall.type 
    691684        transformTarget._transformTo(postCall) 
    692685