Changeset 1599

Show
Ignore:
Timestamp:
08/28/08 06:47:54 (3 months ago)
Author:
Chuck.Esterbrook
Message:

Re: extended initializers, eliminate nil arg checks in the generated helper methods since they are not needed.

Location:
cobra/trunk/Source
Files:
2 modified

Legend:

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

    r1598 r1599  
    14961496                name = '_ch_ext_init_[.serialNum]'  # ch = class helper, ext = extended, init = initializer 
    14971497                m = Method(token.copy('ID', name), box, name, paramsForDecl, _type, nil, ['shared', 'private'], AttributeList(), '') 
     1498                m.isCompilerGenerated = true 
    14981499                m.locals.add(LocalVar(token.copy('ID', 'obj'), .type)) 
    14991500 
  • cobra/trunk/Source/Members.cobra

    r1594 r1599  
    636636        var _hasYieldStmt as bool 
    637637        var _curStmtIndex as int  # to implement .replaceChild 
     638        var _isCompilerGenerated as bool 
    638639        var _sharpResultVarName = '' 
    639640 
     
    666667 
    667668        pro hasYieldStmt from var 
     669 
     670        pro isCompilerGenerated from var 
    668671 
    669672        def addStmt(stmt as Stmt) 
     
    10701073 
    10711074        def writeSharpParamCheck(param as Param, sw as SharpWriter) 
     1075                if .isCompilerGenerated, return 
    10721076                if param.type.isReference and not param.type inherits NilableType and not param.isOut 
    10731077                        if .compiler.options.boolValue('include-nil-checks')