Wiki
Show
Ignore:
Timestamp:
03/08/10 06:19:46 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Code cleanup. In CobraType?.memberForName, assert that the type .didBindInh and .didBindInt. Also, create all nilable types through .typeProvider.nilableType(t) and cache.

Files:
1 modified

Legend:

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

    r2297 r2304  
    30393039    def _bindImp 
    30403040        base._bindImp 
    3041         if _expr.type inherits NilableType 
    3042             _type = _expr.type 
    3043             .compiler.warning(this, 'The given expression is already nilable so "to ?" is redundant. You can remove it.')  # TODO: needs test case 
    3044         else 
    3045             _type = NilableType(_expr.type) 
     3041        if not _expr.hasError 
     3042            assert _expr.type 
     3043            if _expr.type inherits NilableType 
     3044                _type = _expr.type 
     3045                .compiler.warning(this, 'The given expression is already nilable so "to ?" is redundant. You can remove it.')  # TODO: needs test case 
     3046            else 
     3047                _type = .typeProvider.nilableType(_expr.type to !) 
    30463048 
    30473049