using System; public struct KeyValuePair[K,V] { public mutable key : K; public mutable value : V; public this(mutable k : K,mutable v : V) { key = k; value = v; } public this(mutable k : K) { key = k; value =Nemerle.Extensions.DefaultValue(V); } } public class Collection[T] { public Item : T; public this (mutable item : T) { this.Item = item; } public Find (mutable item : ref T) : void { item = Item; } } class X { static Main () : int { mutable p = KeyValuePair (3); mutable q = KeyValuePair (5, 9); mutable c = Collection (q); c.Find (ref p); if (p.key != 5) { 1; } else { { if (p.value != 9) { 2; } else { { 0; } } } } } } /* BEGIN-OUTPUT END-OUTPUT */