Bug 61 - Covariance: working on simulator but crashing on device
Summary: Covariance: working on simulator but crashing on device
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-07-26 03:55 UTC by steott
Modified: 2011-07-26 14:31 UTC (History)
2 users (show)

Tags: covariance
Is this bug a regression?: ---
Last known good build:

Covariance Crash sample (10.67 KB, application/octet-stream)
2011-07-26 03:55 UTC, steott

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description steott 2011-07-26 03:55:11 UTC
Created attachment 15 [details]
Covariance Crash sample

I have a problem with covariance, the strange thing is that the code works on simulator but crashes (close the application!) on the actual device (an iPad with iOS 4.3).

I attach a sample that reproduce the error.
The application is loaded on the iPad, but the crash happens as soon as I click the "test" button.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2011-07-26 14:30:24 UTC
Co- and contra variance is not supported for MonoTouch 4. The reason it doesn't crash on the simulator is that on the simulator managed code isn't compiled to native ahead of time (AOT).

We're working on adding support for co- and contra variance in a future version.