[nem-bug] [Nemerle 0000805]: Does not report inability to infer type arguments

feedback at nemerle.org feedback at nemerle.org
Fri Dec 8 23:04:20 CET 2006


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=805> 
======================================================================
Reported By:                Evin Robertson
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   805
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             12-08-2006 23:04 CET
Last Modified:              12-08-2006 23:04 CET
======================================================================
Summary:                    Does not report inability to infer type arguments
Description: 
The following code prints "false" because nemerle is unable to infer the
type parameter to F, making the call A.F.[object](y).  gmcs rejects the
equivalent C# program.  I think nemerle should do the same.  Attached is a
patch to implement an error, which may or may not be in the right place.

public class X
{
}

public class Y['t] : X
{
}


public module A
{
    public F['t](x : X) : bool
    {
	x is Y['t];
    }

    public Main() : void
    {
        def y = Y() : Y[int];
        def isY = A.F(y).ToString();
        System.Console.WriteLine(isY);
    }
}


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

Issue History
Date Modified  Username       Field                    Change              
======================================================================
12-08-06 23:04 Evin Robertson New Issue                                    
12-08-06 23:04 Evin Robertson File Added: CannotInfer.patch                    
======================================================================




More information about the bugs mailing list