[nem-bug] [Nemerle 0000818]: Cannot implement an interface twice with different type parameters

feedback at nemerle.org feedback at nemerle.org
Sat Jan 6 00:29:27 CET 2007


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=818> 
======================================================================
Reported By:                Evin Robertson
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   818
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             01-06-2007 00:29 CET
Last Modified:              01-06-2007 00:29 CET
======================================================================
Summary:                    Cannot implement an interface twice with different
type parameters
Description: 
The following code does not compile, giving errors:

multiple.n:6:1:17:2: error: type `IA' is implemented by type `A' twice
under different instantiations
multiple.n:6:1:17:2: error: second one directly
multiple.n:6:1:17:2: error: types System.UInt16 and int are not
compatible
multiple.n:6:1:17:2: error: interface `IA' does not contain method named
`GetValue' with proper signature


public interface IA['t]
{
    GetValue() : 't;
}

public class A : IA[int], IA[ushort]
{
    GetIntValue() : int implements IA[int].GetValue
    {
        1
    }

    GetUShortValue() : ushort implements IA[ushort].GetValue
    {
        100 : ushort
    }
}

public class M
{
    public static Main() : void
    {
        def i = A() : IA[int];
        def u = A() : IA[ushort];
        System.Console.WriteLine(i.GetValue() + u.GetValue());
    }
}

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

Issue History
Date Modified  Username       Field                    Change              
======================================================================
01-06-07 00:29 Evin Robertson New Issue                                    
======================================================================




More information about the bugs mailing list