Show
Ignore:
Timestamp:
08/28/08 06:40:46 (4 months ago)
Author:
Chuck.Esterbrook
Message:

Fix a bug in extended initializers.
Also, make the helper methods for them private.

Files:
1 modified

Legend:

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

    r1591 r1598  
    14791479                """ 
    14801480                box = .compiler.curBox 
     1481                token = box.token.copy 
    14811482                paramsForDecl = List<of Param>() 
    14821483                argsForInitCall = List<of Expr>()  # args to pass to `Foo(arg0, arg1)` 
     
    14901491                                arg = arg.right 
    14911492                        else 
    1492                                 argsForInitCall.add(arg) 
     1493                                argsForInitCall.add(IdentifierExpr(token.copy('ID', 'arg[i]'))) 
    14931494                        paramsForDecl.add(Param(box.token.copy('ID', 'arg[i]'), arg.type)) 
    14941495                        i += 1 
    14951496                name = '_ch_ext_init_[.serialNum]'  # ch = class helper, ext = extended, init = initializer 
    1496                 token = box.token.copy 
    1497                 m = Method(token.copy('ID', name), box, name, paramsForDecl, _type, nil, ['shared'], AttributeList(), '') 
     1497                m = Method(token.copy('ID', name), box, name, paramsForDecl, _type, nil, ['shared', 'private'], AttributeList(), '') 
    14981498                m.locals.add(LocalVar(token.copy('ID', 'obj'), .type)) 
    14991499