[nem-bug] [Nemerle 0000982]: Don't work constraint on value type

feedback at nemerle.org feedback at nemerle.org
Sat Mar 31 07:42:17 CEST 2007


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=982> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   982
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             03-31-2007 07:42 CEST
Last Modified:              03-31-2007 07:42 CEST
======================================================================
Summary:                    Don't work constraint on value type
Description: 
public FindValue[T](this seq : SCG.IEnumerable[T], predicate : T -> bool) 
  : T? // E: typing constraint on T not satisfied, upon instantiation 
       // of System.Nullable: System.Object is not a subtype of
System.ValueType [simple require]
  where T : struct
{
  foreach (item in seq)
    when (predicate(item))
      return item;

  null;
}
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
03-31-07 07:42 VladD2         New Issue                                    
======================================================================




More information about the bugs mailing list