Wiki

Changeset 2360

Show
Ignore:
Timestamp:
05/01/10 11:10:17 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Missing inout produces a C# error message rather than a Cobra error message.
ticket:199
credit:hopscc

Location:
cobra/trunk
Files:
1 added
3 modified

Legend:

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

    r2359 r2360  
    458458 
    459459* Fixed: Failure to infer types related to System.Text.RegularExpressions (MatchCollection and GroupCollections items). ticket:163 
     460 
     461* Fixed: Missing `inout` produces a C# error message rather than a Cobra error message.  ticket:199 
  • cobra/trunk/Source/Expr.cobra

    r2350 r2360  
    746746            assert arg.didBindImp 
    747747            assert param.didBindInt 
     748            # check any in/out/inout expectations are matched 
     749            if not param.matchLabel(arg.argumentLabel) 
     750                arg.recordError('Argument [i+1] of method "[_name]" expects a parameter labeled as ([param.kind]), but the call is supplying a label of ([arg.argumentLabel]).') 
    748751            if arg.canBeAssignedTo(param.type) 
    749752                arg.contextType = param.type 
  • cobra/trunk/Source/Vars.cobra

    r2336 r2360  
    216216            catch ne as NodeException 
    217217                .compiler.recordError(ne) 
    218  
    219  
     218                 
     219    def matchLabel(label as ArgumentLabel) as bool 
     220        """ Verify argumentLabel from method argument matches parameter kind """ 
     221        isValid = false 
     222        branch label  
     223            on ArgumentLabel.None 
     224                isValid = .kind == .KindEnum.Value 
     225            on ArgumentLabel.Out 
     226                isValid = .kind == .KindEnum.Out 
     227            on ArgumentLabel.InOut 
     228                isValid = .kind == .KindEnum.InOut 
     229        return isValid 
     230             
    220231class LocalVar inherits AbstractLocalVar is partial 
    221232