Wiki

Changeset 2299

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.

Location:
cobra/trunk
Files:
1 added
9 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Developer/IntermediateReleaseNotes.text

    r2295 r2299  
    436436 
    437437* Fixed: Cannot instantiate generic params under some circumstances. 
     438 
     439* Fixed: Cobra compile failure on delegates calling .(begin|end)Invoke. ticket:196 
  • cobra/trunk/Source/Attributes.cobra

    r2298 r2299  
    107107        return true 
    108108     
    109     get isNames as List<of String> 
     109    get isNames as IList<of String> 
    110110        return List<of String>() 
    111111 
  • 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    """ 
  • cobra/trunk/Source/CobraParser.cobra

    r2244 r2299  
    36373637    """ 
    36383638     
    3639     cue init(isNames as List<of String>, attributes as AttributeList, inheritsProxies as List<of ITypeProxy>, implementsProxies as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>) 
     3639    cue init(isNames as IList<of String>, attributes as AttributeList, inheritsProxies as List<of ITypeProxy>, implementsProxies as List<of ITypeProxy>, addsProxies as List<of ITypeProxy>) 
    36403640        base.init 
    36413641        _isNames = isNames 
     
    36453645        _addsProxies = addsProxies 
    36463646     
    3647     get isNames from var as List<of String> 
     3647    get isNames from var as IList<of String> 
    36483648     
    36493649    get attributes from var as AttributeList 
  • cobra/trunk/Source/Container.cobra

    r2207 r2299  
    8585    var _declsByNameCI as Dictionary<of String, TMember> 
    8686    var _docString as String 
    87     var _isNames as List<of String> 
    88  
    89     cue init(token as IToken, name as String, isNames as List<of String>, docString as String?) 
     87    var _isNames as IList<of String> 
     88 
     89    cue init(token as IToken, name as String, isNames as IList<of String>, docString as String?) 
    9090        .init(nil, token, name, isNames, docString) 
    9191 
    92     cue init(parent as IParentSpace?, token as IToken, name as String, isNames as List<of String>, docString as String?) 
     92    cue init(parent as IParentSpace?, token as IToken, name as String, isNames as IList<of String>, docString as String?) 
    9393        base.init(token, name) 
    9494        _initParent(parent) 
  • cobra/trunk/Source/DocGenerator.cobra

    r2218 r2299  
    265265        .writeIsNames(box.isNames) 
    266266     
    267     def writeIsNames(isNames as List<of String>) 
     267    def writeIsNames(isNames as IList<of String>) 
    268268        if isNames.count 
    269269            .write('is ') 
  • cobra/trunk/Source/Members.cobra

    r2279 r2299  
    3434    var _parentBox as Box 
    3535    var _docString as String? 
    36     var _isNames as List<of String>? 
     36    var _isNames as IList<of String>? 
    3737    var _attribs as AttributeList 
    3838    var _overloadGroup as MemberOverload? 
     
    4343    var _binaryName as String? 
    4444 
    45     cue init(token as IToken, idToken as IToken, parentBox as Box, name as String, isNames as List<of String>, attribs as AttributeList) 
     45    cue init(token as IToken, idToken as IToken, parentBox as Box, name as String, isNames as IList<of String>, attribs as AttributeList) 
    4646        .init(token, idToken, parentBox, name, isNames, attribs, nil) 
    4747 
    48     cue init(token as IToken, idToken as IToken, parentBox as Box, name as String, isNames as List<of String>, attribs as AttributeList, docString as String?) 
     48    cue init(token as IToken, idToken as IToken, parentBox as Box, name as String, isNames as IList<of String>, attribs as AttributeList, docString as String?) 
    4949        base.init(idToken, name) 
    5050        _idToken = idToken 
     
    655655    var _isCompilerGenerated as bool 
    656656 
    657     cue init(token as IToken, idToken as IToken, box as Box, parentMethod as AbstractMethod?, name as String, paramsList as List<of Param>, isNames as List<of String>, attribs as AttributeList, docString as String) 
     657    cue init(token as IToken, idToken as IToken, box as Box, parentMethod as AbstractMethod?, name as String, paramsList as IList<of Param>, isNames as IList<of String>, attribs as AttributeList, docString as String) 
    658658        base.init(token, idToken, box, name, isNames, attribs, docString) 
    659659        _parentMethod = parentMethod 
    660         _params = paramsList 
     660        _params = List<of Param>(paramsList) 
    661661        _oldExprs = List<of OldExpr>() 
    662662        _locals = List<of LocalVar>() 
     
    10231023    var _implementsType as IType? 
    10241024 
    1025     cue init(token as IToken, idToken as IToken, box as Box, name as String, paramsList as List<of Param>, returnTypeNode as ITypeProxy, implementsTypeNode as ITypeProxy?, isNames as List<of String>, attribs as AttributeList, docString as String) 
     1025    cue init(token as IToken, idToken as IToken, box as Box, name as String, paramsList as IList<of Param>, returnTypeNode as ITypeProxy, implementsTypeNode as ITypeProxy?, isNames as IList<of String>, attribs as AttributeList, docString as String) 
    10261026        .init(token, idToken, box, name, List<of IType>(), paramsList, returnTypeNode, implementsTypeNode, isNames, attribs, docString) 
    10271027 
    1028     cue init(token as IToken, idToken as IToken, box as Box, name as String, genericParams as List<of IType>, paramsList as List<of Param>, returnTypeNode as ITypeProxy, implementsTypeNode as ITypeProxy?, isNames as List<of String>, attribs as AttributeList, docString as String) 
     1028    cue init(token as IToken, idToken as IToken, box as Box, name as String, genericParams as List<of IType>, paramsList as IList<of Param>, returnTypeNode as ITypeProxy, implementsTypeNode as ITypeProxy?, isNames as IList<of String>, attribs as AttributeList, docString as String) 
    10291029        base.init(token, idToken, box, nil, name, paramsList, isNames, attribs, docString) 
    10301030        _genericParams = genericParams 
     
    12191219    var _returnTypeNode as ITypeProxy? 
    12201220 
    1221     cue init(token as IToken, idToken as IToken, box as Box, name as String, isNames as List<of String>, attribs as AttributeList, docString as String?) 
     1221    cue init(token as IToken, idToken as IToken, box as Box, name as String, isNames as IList<of String>, attribs as AttributeList, docString as String?) 
    12221222        base.init(token, idToken, box, name, isNames, attribs, docString) 
    12231223 
    1224     cue init(token as IToken, idToken as IToken, box as Box, name as String, returnTypeOrNode as INode, isNames as List<of String>, attribs as AttributeList, docString as String) 
     1224    cue init(token as IToken, idToken as IToken, box as Box, name as String, returnTypeOrNode as INode, isNames as IList<of String>, attribs as AttributeList, docString as String) 
    12251225        .init(token, idToken, box, name, isNames, attribs, docString) 
    12261226        if returnTypeOrNode inherits IType 
     
    13381338    get xetPartName as String is abstract 
    13391339 
    1340     get isNames as List<of String>? is override 
     1340    get isNames as IList<of String>? is override 
    13411341        # may need to get more sophisticated here if, in the future, we support C#'s somewhat recent ability to put access modifiers on just the set or get part of a property 
    13421342        return _parent.isNames 
  • cobra/trunk/Source/NameSpace.cobra

    r2207 r2299  
    88    def extensionMemberFor(box as Box, name as String) as IMember? 
    99    get isFromBinaryLibrary as bool 
    10     get isNames as List<of String> 
     10    get isNames as IList<of String> 
    1111 
    1212 
  • cobra/trunk/Source/Property.cobra

    r2006 r2299  
    33    inherits ProperDexer 
    44 
    5     cue init(token as IToken, idToken as IToken, box as Box, name as String, isNames as List<of String>, attribs as AttributeList, coverVar as BoxVar, coverAccess as String, docString as String) 
     5    cue init(token as IToken, idToken as IToken, box as Box, name as String, isNames as IList<of String>, attribs as AttributeList, coverVar as BoxVar, coverAccess as String, docString as String) 
    66        base.init(token, idToken, box, name, isNames, attribs, docString) 
    77        _coverVar = coverVar 
     
    99        _isNames = isNames 
    1010 
    11     cue init(token as IToken, idToken as IToken, box as Box, name as String, returnTypeOrNode as INode, isNames as List<of String>, attribs as AttributeList, docString as String) 
     11    cue init(token as IToken, idToken as IToken, box as Box, name as String, returnTypeOrNode as INode, isNames as IList<of String>, attribs as AttributeList, docString as String) 
    1212        base.init(token, idToken, box, name, returnTypeOrNode, isNames, attribs, docString) 
    1313