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)

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


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:
Status:
VERIFIED FIXED

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.