[Mono-bugs] [Bug 331191] Compiling fails with a generic class that requires the Type to inherit from an abstract class

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Apr 1 12:34:11 EDT 2008


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

User sontek at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=331191#c4


John Anderson <sontek at gmail.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |sontek at gmail.com




--- Comment #4 from John Anderson <sontek at gmail.com>  2008-04-01 10:34:11 MST ---
I think this code example is because of the same bug:

using System;
using System.Collections.Generic;


internal class InitializeHelper<T> where T : DataObject, new()
{
    public delegate void PerformInitializeCallback(T t, string attr, int
reader);
    public InitializeHelper(PerformInitializeCallback perform, string attr)
    {

    }
}
public abstract class DataObject
{
   public DataObject() { } 
}
public class MsSqlDataObjectFactory : BaseFactory
{
    T[] ExecuteReaderAndGetObjects<T>(int command, string attr) where T :
DataObject, new()
    {
        InitializeHelper<T> helper = new
InitializeHelper<T>(InitializeDataObject, attr);
        return new T[] { };
    }
}
public abstract class BaseFactory
{
    protected void InitializeDataObject(DataObject ob, string attr, int reader)
    {
    }
}


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


More information about the mono-bugs mailing list