[nem-bug] [Nemerle 0000840]: Ambiguity between overloads

feedback at nemerle.org feedback at nemerle.org
Fri Jan 26 18:52:32 CET 2007


The following issue has been UPDATED.
======================================================================
<http://nemerle.org/bugs/view.php?id=840> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   840
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             01-26-2007 18:51 CET
Last Modified:              01-26-2007 18:52 CET
======================================================================
Summary:                    Ambiguity between overloads
Description: 
public module Program
{
  Main() : void
  { 
    def f = Foo; // error : typing fails on ambiguity between overloads
    _ = f(1) 
  }

  public Foo[T](_ : T) : void { }
  public Foo(_ : int)  : void { }
}
-------------------------------------------------------------------
Main.n(5,13,5,16): error : typing fails on ambiguity between overloads:
Main.n(5,13,5,16): error : Posible overload: method Program.Foo(_N_u1548 :
T.867) : void
Main.n(5,13,5,16): error : Posible overload: method Program.Foo(_N_u1549 :
int) : void
-------------------------------------------------------------------

In C# 2.0 it's OK:
using System;

class Program
{
  static void Main()
  {
    Action<int> f = Foo;
    f(1);
  }

  public static void Foo<T>(T x) { }
  public static void Foo(int x) { }
}
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
01-26-07 18:51 VladD2         New Issue                                    
01-26-07 18:52 VladD2         Category                 Code Completion Engine =>
Compiler (type engine)
01-26-07 18:52 VladD2         Description Updated                          
======================================================================




More information about the bugs mailing list