[nem-bug] [Nemerle 0000800]: System.Void as a generic type argument

feedback at nemerle.org feedback at nemerle.org
Thu Jan 25 15:57:13 CET 2007


The following issue has been ASSIGNED.
======================================================================
<http://nemerle.org/bugs/view.php?id=800> 
======================================================================
Reported By:                Evin Robertson
Assigned To:                nazgul
======================================================================
Project:                    Nemerle
Issue ID:                   800
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
======================================================================
Date Submitted:             12-03-2006 04:53 CET
Last Modified:              01-25-2007 15:57 CET
======================================================================
Summary:                    System.Void as a generic type argument
Description: 
The following code compiles, but it should not (void is an invalid generic
type argument).  Nemerle distinguishes void from System.Void.  Attached is
a patch that makes MType.Equals consider void and System.Void equal.

public class A['a]
{
}

public class B
{
    public F() : void
    {
        _ = A() : A[System.Void]
    }
}

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

----------------------------------------------------------------------
 nazgul - 12-03-06 22:58 
----------------------------------------------------------------------
This is a deeper problem - System.Void should be converted to MType.Void at
the phase of parse tree --> type conversion.

I will try to make the proper change - thanks for the patch, I will start
from it.

----------------------------------------------------------------------
 nazgul - 12-03-06 23:19 
----------------------------------------------------------------------
Fixed on trunk (r7037)

----------------------------------------------------------------------
 nazgul - 01-25-07 15:57 
----------------------------------------------------------------------
using System.Console;

public class Stuff
{
   static Main() : void
   {
       Foo(null : object);
       Foo(());
       _ = ReadLine();
   }

   static Foo[T](obj : T) : void
   {
       WriteLine(typeof(T));
       WriteLine(Equals(obj, null))
   }
}

Issue History
Date Modified  Username       Field                    Change              
======================================================================
12-03-06 04:53 Evin Robertson New Issue                                    
12-03-06 04:53 Evin Robertson File Added: voidvoid.patch                    
12-03-06 22:58 nazgul         Note Added: 0001550                          
12-03-06 23:19 nazgul         Status                   new => resolved     
12-03-06 23:19 nazgul         Resolution               open => fixed       
12-03-06 23:19 nazgul         Assigned To               => nazgul          
12-03-06 23:19 nazgul         Note Added: 0001551                          
12-03-06 23:19 nazgul         Description Updated                          
01-25-07 15:57 nazgul         Note Added: 0001636                          
01-25-07 15:57 nazgul         Status                   resolved => assigned
01-25-07 15:57 nazgul         Description Updated                          
======================================================================




More information about the bugs mailing list