Wiki

Changeset 2287

Show
Ignore:
Timestamp:
02/14/10 07:21:12 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Improved error recovery. Avoid an uncaught exception in the compiler.
Unfortunately, I do not have a new (self contained, small) test case for this.
Existing test cases pass.

Files:
1 modified

Legend:

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

    r2284 r2287  
    566566                return 
    567567 
    568         _bindImpArgs 
     568        hasErrors = _bindImpArgs 
    569569        definition as IMember? 
    570570        type as IType? 
     
    588588                # there is a FallThroughException down below that would report this if it happened 
    589589                if definition inherits BoxMember 
    590                     if not .hasError 
     590                    if not .hasError and not hasErrors 
    591591                        args = _args 
    592592                        if definition inherits MemberOverload 
     
    595595                            # http://www.google.com/search?hl=en&q=C%23+overloaded+method+resolution 
    596596                            # TODO: handle type inference for generic members. See the C# spec for details. 
    597                          
    598597                            winner = definition.computeBestOverload(.args, .genericArgTypes, true) 
    599598                            sharp'definition = winner' 
     
    692691        transformTarget._transformTo(postCall) 
    693692 
    694     def _bindImpArgs 
     693    def _bindImpArgs as bool 
     694        hasErrors = false 
    695695        num = 1 
    696696        for arg in List<of Expr>(_args) 
     
    706706                ne.prefixMessage('For "[_name]" arg [num]: ') 
    707707                .compiler.recordError(ne) 
     708                hasErrors = true 
    708709            num += 1 
     710        return hasErrors 
    709711 
    710712    def _didVariArgs(definition as BoxMember) as bool