[nem-bug] [Nemerle 0000540]: Using void as generic argument causes invalid IL

feedback at nemerle.org feedback at nemerle.org
Sat Oct 1 17:39:41 CEST 2005


The following issue has been SUBMITTED.
======================================================================
<https://nemerle.org/bugs/view.php?id=540> 
======================================================================
Reported By:                steffen
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   540
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             10-01-2005 17:39 CEST
Last Modified:              10-01-2005 17:39 CEST
======================================================================
Summary:                    Using void as generic argument causes invalid IL
Description: 
The following code compiles but generates invalid IL:

module X {
    f['a] (_:'a):void {}

    Main():void {
        f( () );
    }
}

The following code however compiles and runs:

module X {
    f['a] ():'a { Nemerle.Extensions.DefaultValue ('a) }

    Main():void {
        f.[void]();
    }
}

(The second case is like Util.ice in the compiler. It is translated to _ =
f.[object]() .)

The CIL spec says:
The following kinds of type cannot be used as arguments in instantiations
(of generic types or methods):
...
void (e.g., List<System.Void> is invalid)


So either the compiler should complain about using void as type argument
or should translate it to something different (like System.Object, as
already done in the second case).
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
10-01-05 17:39 steffen        New Issue                                    
======================================================================




More information about the bugs mailing list