Generics mtouch AOT缺少编译

Generics mtouch AOT缺少编译,generics,xamarin.ios,aot,Generics,Xamarin.ios,Aot,我在mtouch中遇到了一种奇怪的行为;我知道AOT在特定情况下可能会失败,但我认为这个问题有点不同 下面是一些代码: public class TTableCell { } public class TTableElement<T> where T: TTableElement<T> { public void SetProperty<TV> (ref TV backingStorage, string propName, TV value

我在mtouch中遇到了一种奇怪的行为;我知道AOT在特定情况下可能会失败,但我认为这个问题有点不同

下面是一些代码:

public class TTableCell
{
}

public class TTableElement<T>
    where T: TTableElement<T>
{
    public void SetProperty<TV> (ref TV backingStorage, string propName, TV value)
    {
        backingStorage = value;
    }
}

public class TAbstractTableItem<TC> : TTableElement<TAbstractTableItem<TC>>
    where TC : TTableCell
{
    public TAbstractTableItem ()
    {
    }

    string _string;
    bool _bool;

    public void DoException ()
    {
        SetProperty (ref _string, "String", "Bla bla");
        SetProperty (ref _bool, "Boolean", false);
    }
}
公共类TTableCell
{
}
公共类可删除元素
其中T:TTableElement
{
public void SetProperty(参考TV backingStorage、字符串propName、TV值)
{
备份存储=值;
}
}
公共类TAbstractTableItem:TTableElement
其中TC:TTableCell
{
公共选项卡StractTableItem()
{
}
字符串_字符串;
布尔(bool),;
公共无效DoException()
{
SetProperty(参考字符串、“字符串”、“Bla Bla”);
SetProperty(参考布尔值,“布尔值”,假);
}
}
现在,如果在其他地方执行以下操作:

TTableItem<TTableCell> item = new TTableItem<TTableCell> ();
item.DoException ();
TTableItem项目=新的TTableItem();
item.DoException();
我得到一个例外:

Unhandled managed exception: Attempting to JIT compile method 'TouchSandbox.TTableElement`1<TouchSandbox.TAbstractTableItem`1<TouchSandbox.TTableCell>>:SetProperty<bool> (bool&,string,bool)'
未处理的托管异常:正在尝试JIT编译方法'touchandbox.TTableElement`1:SetProperty(bool&,string,bool)'
现在,请注意,异常只针对布尔版本的
SetProperty
,而不是字符串版本引发。在我的项目中,我为方法使用了各种类型(也有自定义类型),而这个问题只发生在bool中

有人能帮我吗

谢谢

塞尔吉奥

注意:显然,该问题仅出现在iDevice中(而不是模拟器中)

更新


好的,在搜索了xamarin的bugzilla之后,我发现了一张票(实际上有点旧!),它突出了mtouch AOT中的一个缺陷:。可悲的是,他们似乎还没有修好

泛型类中的泛型方法似乎存在问题


我还尝试了6.3测试版的测试用例(这可能会解决这个问题,因为很多东西在这方面都有改进),但是它崩溃了,而不是抛出异常(-你可以在修复后抄送自己进行更新)。

是的,谢谢。。。事实上,我已经尝试过其他值类型(int、float、DateTime),似乎它与它们相关。