Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug][Shapes] Shapes demos has some invalid IL code once updated to 4.8-pre2 #11541

Closed
davidbritch opened this issue Jul 24, 2020 · 4 comments
Closed
Assignees
Labels
a/shapes a/Xaml </> e/5 🕔 5 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛

Comments

@davidbritch
Copy link

davidbritch commented Jul 24, 2020

Description

I've just updated my Shapes demos sample from 4.7 to 4.8-pre2, in order to try Shapes with Brushes. As a result there are InvalidProgramExceptions in two pages.

Steps to Reproduce

  1. Run the attached sample
  2. Browse to the image clipping demo page or path geometry demo page.

Expected Behavior

Pages load and work as expected.

Actual Behavior

InvalidOperationException on those pages: Invalid IL code

System.InvalidProgramException: Invalid IL code in ShapesDemos.ClipDemoPage:InitializeComponent (): IL_04d6: box 0x01000054

at ShapesDemos.ClipDemoPage..ctor () [0x00008] in /Users/davidbritch/repos/xamarin-forms-samples/UserInterface/ShapesDemos/ShapesDemos/Views/ClipDemoPage.xaml.cs:9
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:936

Basic Information

  • Version with issue: 4.8-pre2
  • Last known good version: 4.7
  • IDE: VSMac 8.6.7
  • Platform Target Frameworks:
    • iOS: 13.6
    • Android: API 28

Reproduction Link

ShapesDemos.zip

@davidbritch davidbritch added t/bug 🐛 s/unverified New report that has yet to be verified labels Jul 24, 2020
@StephaneDelcroix StephaneDelcroix self-assigned this Jul 24, 2020
@StephaneDelcroix StephaneDelcroix added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often a/brushes a/Xaml </> labels Jul 24, 2020
@StephaneDelcroix
Copy link
Member

StephaneDelcroix commented Jul 24, 2020

I suspect the InvalidOperation issue comes from RectTypeConverter inheriting from RectangleTypeConverter, and the Xaml compiler picking the 'wrong' attribute, and the wrong return type, forcing a cast where it's not required

@hartez hartez removed the s/unverified New report that has yet to be verified label Jul 24, 2020
@hartez hartez added the e/5 🕔 5 label Jul 24, 2020
StephaneDelcroix added a commit that referenced this issue Jul 24, 2020
Fix inheritance of RectTypeConverter from RectangleTypeConverter, as the
child isn't precompiled, even if the parent has the attribute...

- fixes #11541
@npagare
Copy link

npagare commented Jul 25, 2020

Hi @StephaneDelcroix ,
I tested the interim nuget package, and it failed for RECT API for the XAML sample that I provided in #11551 / step 3.

System.InvalidOperationException
Message=The BindableProperty "Width" is readonly.

This was not the case before in the Struct Rectangle that is being replaced with RECT.

@StephaneDelcroix
Copy link
Member

@IoTFier this step 3
image ?

@StephaneDelcroix
Copy link
Member

you meant that <Rect x:Key="TemplateLayoutBounds" HeightRequest="22" WidthRequest="{x:Static AbsoluteLayout.AutoSize}" X="1" Y="0.5" />

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/shapes a/Xaml </> e/5 🕔 5 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants