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

feedback at nemerle.org feedback at nemerle.org
Sat May 19 14:15:06 CEST 2007


A NOTE has been added to this issue.
======================================================================
<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:                     new
======================================================================
Date Submitted:             05-19-2007 13:46 CEST
Last Modified:              05-19-2007 14:15 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#?

Issue History
Date Modified  Username       Field                    Change              
======================================================================
05-19-07 13:46 divan          New Issue                                    
05-19-07 14:15 nazgul         Note Added: 0001895                          
======================================================================




More information about the bugs mailing list