Bugzilla – Bug 318264
[GMCS] a little bit more type inference should be performed by gmcs
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by nazgul@omega.pl 2005-06-14 12:09:11 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: csc 2.0 beta 2 understand code demanding a slightly more type inference, than gmcs do currently Steps to reproduce the problem: 1. Try to compile following code class list <A> { public class Cons <T> : list <T> { } public class Nil <T> : list <T> { } } class C { public static void Rev<T> (list <T> y) { if (y is list<object>.Cons<T>) System.Console.WriteLine ("Cons"); if (y is list<object>.Nil<T>) System.Console.WriteLine ("Nil"); } } class M { static void Main () { C.Rev (new list<object>.Cons <string> ()); C.Rev (new list<object>.Nil <string> ()); } } 2. 3. Actual Results: t.cs(24) error CS0411: The type arguments for method `Rev' cannot be infered from the usage. Try specifying the type arguments explicitly. abla t.cs(25) error CS0411: The type arguments for method `Rev' cannot be infered from the usage. Try specifying the type arguments explicitly. Expected Results: clear compiler How often does this happen? Always Additional Information: ---- Additional Comments From martin@ximian.com 2005-06-20 12:01:16 MST ---- Fixed in SVN. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>PLD linux, mono from svn (13.07.2005)</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".