Wiki
Show
Ignore:
Timestamp:
03/05/10 04:41:04 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Fixed: Cobra compile failure on delegates calling .(begin|end)Invoke. ticket:196
Code cleanup. Using IList over List more.

Files:
1 modified

Legend:

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

    r2282 r2299  
    4141        """ 
    4242 
    43     cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as List<of String>, attribs as AttributeList, baseInterfaceNodes as List<of ITypeProxy>, docString as String?) 
     43    cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as IList<of String>, attribs as AttributeList, baseInterfaceNodes as List<of ITypeProxy>, docString as String?) 
    4444        base.init(token, name, isNames, docString) 
    4545        _idToken = idToken 
     
    11101110    var _addsProxies as List<of ITypeProxy> 
    11111111 
    1112     cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as List<of String>, attribs as AttributeList, implementsNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
     1112    cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as IList<of String>, attribs as AttributeList, implementsNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
    11131113        base.init(token, idToken, name, paramList, isNames, attribs, implementsNodes, docString) 
    11141114        _addsProxies = addsProxies 
     
    11621162    var _subclasses = List<of Class>() 
    11631163 
    1164     cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as List<of String>, attribs as AttributeList, baseNode as ITypeProxy?, implementsNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
     1164    cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as IList<of String>, attribs as AttributeList, baseNode as ITypeProxy?, implementsNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
    11651165        base.init(token, idToken, name, paramList, isNames, attribs, implementsNodes, addsProxies, docString) 
    11661166        _baseNode = baseNode 
     
    13171317    # because we need them for class, struct and mixin, but not for interfaces. Awesome!  :-) 
    13181318     
    1319     cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as List<of String>, attribs as AttributeList, baseNode as ITypeProxy?, implementsNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
     1319    cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as IList<of String>, attribs as AttributeList, baseNode as ITypeProxy?, implementsNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
    13201320        base.init(token, idToken, name, paramList, isNames, attribs, implementsNodes, docString) 
    13211321        # there are restrictions on mixins which may be relaxed in the future 
     
    13691369    inherits Box 
    13701370 
    1371     cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as List<of String>, attribs as AttributeList, baseNodes as List<of ITypeProxy>, docString as String?) 
     1371    cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as IList<of String>, attribs as AttributeList, baseNodes as List<of ITypeProxy>, docString as String?) 
    13721372        base.init(token, idToken, name, paramList, isNames, attribs, baseNodes, docString) 
    13731373         
     
    14081408    inherits ClassOrStruct 
    14091409 
    1410     cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as List<of String>, attribs as AttributeList, baseName as String?, interfaceNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
     1410    cue init(token as IToken, idToken as IToken, name as String, paramList as List<of IType>, isNames as IList<of String>, attribs as AttributeList, baseName as String?, interfaceNodes as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>, docString as String?) 
    14111411        base.init(token, idToken, name, paramList, isNames, attribs, interfaceNodes, addsProxies, docString) 
    14121412 
     
    14901490 
    14911491    def _bindInt 
    1492         m = Method(.token, .token, this, 'invoke', List<of Param>(.params), .returnType ? .returnTypeProxy, nil, List<of String>(.isNames), AttributeList(), '') 
    1493         m.statements.add(ThrowStmt(.token, PostCallExpr(.token, IdentifierExpr(.token, 'Exception'), List<of Expr>()))) # just to avoid a Cobra warning during .bindImp 
    1494         .addDecl(m) 
     1492        returnType as ITypeProxy = .returnType ? .returnTypeProxy 
     1493        .addDecl(_makeMethod('invoke', .params.clone, returnType)) 
     1494        # dynamic type vari length param in list as placeholder for multiple params  
     1495        params = [Param('vParam', VariTypeIdentifier(.token, TypeIdentifier(.token, DynamicType())))] 
     1496        .addDecl(_makeMethod('beginInvoke', params, TypeIdentifier(.token.copy('ID', 'IAsyncResult')) to ITypeProxy)) 
     1497        .addDecl(_makeMethod('endInvoke',   params, returnType )) 
    14951498        base._bindInt 
    14961499        for param in .params 
     
    15021505        pass 
    15031506 
    1504  
     1507    def _makeMethod(name as String, params as IList<of Param>, returnTypeProxy as ITypeProxy) as Method 
     1508        m = Method(.token, .token, this, name, params, returnTypeProxy, nil, .isNames.clone, AttributeList(), '') 
     1509        # method body just to avoid a Cobra warning during .bindImp 
     1510        m.statements.add(ThrowStmt(.token, PostCallExpr(.token, IdentifierExpr(.token, 'Exception'), List<of Expr>())))  
     1511        return m 
     1512         
    15051513class GenericParam inherits CobraType is partial 
    15061514    """