[nem-bug] [Nemerle 0000368]: sum type for overloaded call result

feedback at nemerle.org feedback at nemerle.org
Thu Nov 23 19:24:48 CET 2006


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=368> 
======================================================================
Reported By:                malekith
Assigned To:                malekith
======================================================================
Project:                    Nemerle
Issue ID:                   368
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             03-15-2005 10:41 CET
Last Modified:              11-23-2006 19:24 CET
======================================================================
Summary:                    sum type for overloaded call result
Description: 
Consider the code:

module M {
  public static Main () : void
  {

        def copy (src)
        {
            def files = System.IO.Directory.GetFiles (src);

            foreach (file : string in files){
              _ = file;
            }
        }

        copy("foo");
  }
}

It currently doesn't compile, because GetFiles have two overloads
(string -> array [string]) and (string * string -> array [string]),
and foreach screams about unknown type of files.

Now there are two ways to solve it, both should be used. First one
is to delay foreach until type of files is known.

Second is to use sum of array[string] and array[string] (which is,
ergh... array[string]) as the result of overloaded call.


======================================================================

----------------------------------------------------------------------
 nazgul - 11-23-06 19:24 
----------------------------------------------------------------------
I guess the delay scenario is performed now :) and the sum scenario does
not apply now. Added testcase in r6987.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
03-15-05 10:41 malekith       New Issue                                    
11-23-06 19:24 nazgul         Status                   assigned => resolved
11-23-06 19:24 nazgul         Resolution               open => fixed       
11-23-06 19:24 nazgul         Note Added: 0001518                          
======================================================================




More information about the bugs mailing list