[Mono-bugs] [Bug 422507] Generic iterator methods getting invalid type information

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 3 10:40:52 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=422507

User lluis at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422507#c2


Lluis Sanchez <lluis at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
             Status|RESOLVED                                        |REOPENED
         Resolution|FIXED                                           |




--- Comment #2 from Lluis Sanchez <lluis at novell.com>  2008-09-03 08:40:52 MDT ---
The following test case is still printing incorrect results.

using System;
using System.Collections;
using System.Collections.Generic;

class App
{
        public static void Main (string[] args)
        {
                foreach (object o in QueryEnumerable<string>())
                        Console.WriteLine (o);
        }

        public static IEnumerable QueryEnumerable<T> ()
        {
                Console.WriteLine ("Type 1: " + typeof(T));
                yield return (T) TestType (typeof(T));
        }

        public static object TestType (Type t)
        {
                Console.WriteLine ("Type 2: " + t);
                return null;
        }
}

It prints:

Type 1: System.String
Type 2: 0

while it should print:

Type 1: System.String
Type 2: System.String


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list