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

feedback at nemerle.org feedback at nemerle.org
Sun Jun 17 22:05:39 CEST 2007


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=800> 
======================================================================
Reported By:                Evin Robertson
Assigned To:                divan
======================================================================
Project:                    Nemerle
Issue ID:                   800
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             12-03-2006 04:53 CET
Last Modified:              06-17-2007 22:05 CEST
======================================================================
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))
   }
}

----------------------------------------------------------------------
 nazgul - 01-25-07 17:29 
----------------------------------------------------------------------
Remove assignment

----------------------------------------------------------------------
 divan - 06-17-07 22:05 
----------------------------------------------------------------------
Fixed ob trunk r7708.

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                          
01-25-07 17:29 nazgul         Note Added: 0001637                          
01-25-07 17:29 nazgul         Assigned To              nazgul =>           
01-25-07 17:29 nazgul         Status                   assigned => new     
01-25-07 17:29 nazgul         Description Updated                          
06-17-07 22:05 divan          Note Added: 0001918                          
06-17-07 22:05 divan          Assigned To               => divan           
06-17-07 22:05 divan          Status                   new => resolved     
06-17-07 22:05 divan          Description Updated                          
======================================================================




More information about the bugs mailing list