Changeset 1577

Show
Ignore:
Timestamp:
08/14/08 06:57:27 (3 months ago)
Author:
Chuck.Esterbrook
Message:

* Fixed: Using ref on a variable that experienced an error causes an internal exception.

Location:
cobra/trunk
Files:
4 modified

Legend:

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

    r1576 r1577  
    9999 
    100100* Fixed: Cannot use the `branch` statement if the expression has a dynamic type. 
     101 
     102* Fixed: Using `ref` on a variable that experienced an error causes an internal exception. 
  • cobra/trunk/Source/BinaryOpExpr.cobra

    r1562 r1577  
    11141114                        on 'NOTIN', sw.write('!') 
    11151115                        on 'IN', pass 
    1116                         else: throw FallThroughException(_op) 
     1116                        else, throw FallThroughException(_op) 
    11171117                if _containsExpr 
    11181118                        _containsExpr.writeSharpDef(sw, parens) 
  • cobra/trunk/Source/Expr.cobra

    r1564 r1577  
    19221922                                if right.definition inherits AbstractMethod or right.definition inherits MemberOverload 
    19231923                                        right.isReference = true 
     1924                                else if right.definition is nil 
     1925                                        # happens from error recovery such as: obj = BadClassName() ... ref obj.foo 
     1926                                        pass 
    19241927                                else 
    19251928                                        .throwError('Only methods can be referenced, not [right.definition.englishName].') 
  • cobra/trunk/Tests/220-delegates-etc/100-delegates/130-ref-error.cobra

    r1442 r1577  
    77        def init(command as BindMethod) 
    88                _command = ref command       # .error. Only methods can be referenced, not parameters. 
     9 
     10                x = X() 
     11                _command = ref x.foo  # .error. Cannot find a definition for "foo" 
     12 
     13                bad = BadClassName()  # .error. Cannot find "BadClassName". 
     14                _command = ref bad.method  # use to throw exception in compiler