[nem-bug] [Nemerle 0001017]: cast null to 'new' generic parameter

feedback at nemerle.org feedback at nemerle.org
Sat May 19 14:36:02 CEST 2007


The following issue has been CLOSED
======================================================================
<http://nemerle.org/bugs/view.php?id=1017> 
======================================================================
Reported By:                divan
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   1017
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 not an issue
Fixed in Version:           
======================================================================
Date Submitted:             05-19-2007 13:46 CEST
Last Modified:              05-19-2007 14:36 CEST
======================================================================
Summary:                    cast null to 'new' generic parameter
Description: 
Following doesn't compile unless cast is uncommented.

public class A [T] where T : new ()
{
 public f () : T 
 {
  null // :> T
 }
}
()

Error is: expected T.902, got System.Object+ in function return value: the
`null' literal is not a valid value of type T.902

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

----------------------------------------------------------------------
 nazgul - 05-19-07 14:15 
----------------------------------------------------------------------
Hm... 'new()' does not imply 'class' I guess. Could you check in C#?

----------------------------------------------------------------------
 divan - 05-19-07 14:36 
----------------------------------------------------------------------
Oops, it surely doesn't.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
05-19-07 13:46 divan          New Issue                                    
05-19-07 14:15 nazgul         Note Added: 0001895                          
05-19-07 14:36 divan          Note Added: 0001896                          
05-19-07 14:36 divan          Status                   new => closed       
05-19-07 14:36 divan          Resolution               open => not an issue
05-19-07 14:36 divan          View Status              public => private   
05-19-07 14:36 divan          Summary                  cast null to 'new'
generic parameter => cast null to \'new\' generic parameter
05-19-07 14:36 divan          Description Updated                          
05-19-07 14:36 divan          Additional Information Updated                    
======================================================================




More information about the bugs mailing list