Bug 46921 - XAML compiler produces invalid IL for resources using property element syntax, or even attributes
Summary: XAML compiler produces invalid IL for resources using property element syntax...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 42385 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-14 02:46 UTC by Kent
Modified: 2017-02-07 16:15 UTC (History)
6 users (show)

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


Attachments
Repro solution (186.80 KB, application/x-zip-compressed)
2016-11-14 02:46 UTC, Kent
Details

Description Kent 2016-11-14 02:46:48 UTC
Created attachment 18449 [details]
Repro solution

See attached sample. Also tried in latest stable (2.3.2.127) with same result.

The App.xaml file includes the same resource defined four different ways:

    <Thickness x:Key="SomeThickness">4,20,4,20</Thickness>

    <Thickness
        x:Key="SomeThickness"
        Left="4"
        Top="20"
        Bottom="20"
        Right="4"/>

    <Thickness x:Key="SomeThickness">
        <Thickness.Left>
            4
        </Thickness.Left>
        <Thickness.Top>
            20
        </Thickness.Top>
        <Thickness.Bottom>
            20
        </Thickness.Bottom>
        <Thickness.Right>
            4
        </Thickness.Right>
    </Thickness>

    <Thickness x:Key="SomeThickness">
        <Thickness.Left>
            <x:Double>4</x:Double>
        </Thickness.Left>
        <Thickness.Top>
            <x:Double>20</x:Double>
        </Thickness.Top>
        <Thickness.Bottom>
            <x:Double>20</x:Double>
        </Thickness.Bottom>
        <Thickness.Right>
            <x:Double>4</x:Double>
        </Thickness.Right>
    </Thickness>

Only the first way works - the others result in invalid IL. Disabling compilation for only the App.xaml file results in the desired behavior, but obviously to the detriment of runtime performance.
Comment 1 Stephane Delcroix 2016-11-29 20:59:34 UTC
Thanks for this report. I'll work on that as soon as possible
Comment 2 Stephane Delcroix 2016-12-03 13:27:40 UTC
https://github.com/xamarin/Xamarin.Forms/pull/596
Comment 3 Stephane Delcroix 2016-12-20 16:42:33 UTC
this has been fixed, and will be part of 2.3.4-pre2
Comment 4 Stephane Delcroix 2017-01-18 09:33:53 UTC
*** Bug 42385 has been marked as a duplicate of this bug. ***
Comment 5 Parmendra Kumar 2017-02-07 16:15:57 UTC
I have checked this issue with Xamarin.Forms 2.3.4.192-pre2 and observed that this issue has been fixed.

Hence marked this issue as Verified Fixed.

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

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.

Note You need to log in before you can comment on or make changes to this bug.