Skip to content

MonoTouch: JsonDeserializer causes internal consistency error #293

@nicwise

Description

@nicwise

Hi

I've been trying to track down a problem in my MonoTouch app, which I updated to 103.1 yesterday.

It appears to be caused by this change:

85d4693

Specifically:

    private IList BuildList(Type type, object parent)
    {
        var list = (IList)Activator.CreateInstance(type);
        //var listType = type.GetInterfaces().First(x => x.GetGenericTypeDefinition() == typeof(IList<>));
        //var itemType = listType.GetGenericArguments()[0];
        var itemType = type.GetGenericArguments()[0];

(the 2 commented lines are the current code. The line after is what it USED to be)

The MonoTouch bug case is here:

https://bugzilla.xamarin.com/show_bug.cgi?id=6031

I'm not sure of the repercussions of the change above, but it makes my code work, where before it was crashing around 75% of the time.

Is there another way to do it? it's the First(x => x.GetGenericTypeDefinition()) which is causing the issue.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions