Wiki

Ticket #78: ticket78.patch

File ticket78.patch, 2.3 KB (added by hopscc, 16 years ago)
  • Source/Statements.cobra

     
    912912                    .throwError('Expecting an event to raise.') 
    913913            else if expr inherits IdentifierExpr  # ex: raise _eventName 
    914914                _name = expr.name 
    915                 assert expr.potentialType 
    916915                _eventType = expr.potentialType 
     916                if not _eventType 
     917                    hint = '' 
     918                    if expr.type inherits MethodSig  
     919                        hint = 'Did you mean to use "[_name](args)" to invoke the methodSig Identifier (delegate)?' 
     920                    .throwError('The identifier target of "raise" is not an event. [hint]') 
    917921                if _eventType.isDescendantOf(.compiler.delegateType) 
    918922                    pass 
    919923                else if _eventType.isDescendantOf(.compiler.exceptionType) 
  • Tests/820-errors/300-statements/320-raise-not-event.cobra

     
     1class Test 
     2 
     3    sig SimpleMethod 
     4 
     5    def foo(s as SimpleMethod) 
     6        raise s  # .error. invoke the methodSig Identifier 
     7         
     8    def foo2(s as SimpleMethod) 
     9        f=10 
     10        raise f # .error. target of "raise" is not an event 
     11         
     12    def foo3(s as SimpleMethod) 
     13        s() 
     14 
     15    def y 
     16        print 'Fired y' 
     17     
     18    def main is shared 
     19        x = Test() 
     20        x.foo( ref x.y) 
  • Developer/IntermediateReleaseNotes.text

     
    178178 
    179179* Added keyword `each`, reserved for future use. Added keywords for various modifiers that were already in use: `abstract`, `extern`, `fake`, `internal`, `new`, `nonvirtual`, `override`, `partial`, `public`, `private`, `protected`, `virtual`. Deprecated `fake` in favor of new `extern`. 
    180180 
     181* Fixed: Raise on a delegate should generate error message. ticket:78. 
     182 
    181183* Fixed: The Cobra command line compiler throws an exception for files with an all capital extension (FOO.COBRA). 
    182184 
    183185* Fixed: Using "continue" in new style numeric for loops does not increment the loop variable. ticket:9