[nem-bug] [Nemerle 0000638]: Co/contravariance for generic
interfaces / delegates
feedback at nemerle.org
feedback at nemerle.org
Sat Mar 25 20:44:36 CET 2006
A NOTE has been added to this issue.
======================================================================
<https://nemerle.org/bugs/view.php?id=638>
======================================================================
Reported By: steffen
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 638
Category: Compiler
Reproducibility: always
Severity: feature
Priority: normal
Status: new
======================================================================
Date Submitted: 03-25-2006 19:55 CET
Last Modified: 03-25-2006 20:44 CET
======================================================================
Summary: Co/contravariance for generic interfaces / delegates
Description:
It would be nice to have co/contravariance support for generic parameters
of interfaces and delegates.
I.e. you should be able to do something like this:
interface IEnumerator[[covariant] T] {
Current : T { get; }
MoveNext() : bool;
}
interface IComparer[[contravariant] T] {
Compare(x : T, y : T);
}
delegate EventHandler[[contravariant] T](arg : T) : void;
(The examples are from the CLI Spec II 9.5)
Btw.: It seems tha ncc doesn't support attribute for type parameter, e.g.
public class attr : System.Attribute { }
public interface X[[attr] 'a] { }
fails to compile.
======================================================================
----------------------------------------------------------------------
malekith - 03-25-06 20:44
----------------------------------------------------------------------
We thought about this. I guess even SRE allows this, but we were affraid
mono SRE would just crash on it (and even if SRE supported this, the
runtime is probably not tested). Of course this is not a justficiation to
skip this feature :-)
Issue History
Date Modified Username Field Change
======================================================================
03-25-06 19:55 steffen New Issue
03-25-06 20:44 malekith Note Added: 0001123
======================================================================
More information about the bugs
mailing list