Bug 53350 - XAML Compilation fails using generic argument in property
Summary: XAML Compilation fails using generic argument in property
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.4
Hardware: Macintosh Mac OS
: --- major
Target Milestone: ---
Assignee: Stephane Delcroix
Depends on:
Reported: 2017-03-15 12:06 UTC by Tom Gilder
Modified: 2017-06-21 08:36 UTC (History)
4 users (show)

Tags: xamlc, generics, AC
Is this bug a regression?: ---
Last known good build:

Test case project (30.00 KB, application/zip)
2017-03-15 12:06 UTC, Tom Gilder

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 Tom Gilder 2017-03-15 12:06:18 UTC
Trying to compile a XAML property that uses a generic type fails.

# Steps to reproduce

1. Open attached project in Xamarin Studio 
2. Try to compile the "GenericXamlC" project

# Expected behavior

Compiles successfully 

# Actual behavior

Fails to compile with error "Object reference not set to an instance of an object".

This is due to trying to set the "GenericThing" property on "MyStringControl" in GenericXamlCPage.xaml.

# Supplemental info (logs, images, videos)

Works fine with XAML compilation disabled

# Test environment (full version information)
Tested on Xamarin.Forms and
Comment 1 Tom Gilder 2017-03-15 12:06:43 UTC
Created attachment 20345 [details]
Test case project
Comment 2 Jimmy [MSFT] 2017-03-15 15:27:42 UTC
I was able to reproduce this build error with the attached repro project on both Forms and 2.3.4-pre5. When building the project with XamlC enabled it fails with

> Object reference not set to an instance of an object.

Full build output: https://gist.github.com/jimmgarrido/7b408f9f984d161b1642739983b387e5

I am confirming this report so the team can investigate further.
Comment 3 Stephane Delcroix 2017-06-15 10:03:28 UTC
see https://github.com/xamarin/Xamarin.Forms/pull/995