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

[Bug] 4.8-pre3 regression with XAML-defined arrays - x:Int32 is no longer of type x:Object #11620

Closed
Tommigun1980 opened this issue Jul 31, 2020 · 3 comments
Assignees
Labels
4.8.0 regression on 4.8.0 a/buildchain a/Xaml </> i/regression in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Milestone

Comments

@Tommigun1980
Copy link

Tommigun1980 commented Jul 31, 2020

Defining an array with mixed types no longer works in pre3; this has worked in all versions up 'til pre3.

<x:Array x:Key="myArray" Type="{x:Type x:Object}">
    <x:String>Some string</x:String>
    <x:Int32>69</x:Int32>
    <x:Int32>32</x:Int32>
</x:Array>

The error message is

Error XFC0009: No property, BindableProperty, or event found for "Items", or mismatching type between value and property. (XFC0009) (MyMapp) XamlC

and points to the line with the first Int32 declaration. If I remove the ints then it compiles fine. The error happens both with the Type="{x:Type x:Object}" type declaration and without type declaration.
The use case is to define options for a picker, where some options are strings and some integers.

@Tommigun1980 Tommigun1980 added s/unverified New report that has yet to be verified t/bug 🐛 labels Jul 31, 2020
@samhouts samhouts added this to New in Triage Jul 31, 2020
@Tommigun1980
Copy link
Author

Tommigun1980 commented Aug 1, 2020

Edit!

Seems as the problem is not mixing data types, but rather that x:Int32 is no longer treated as being of type x:Object.

The following won't work either:

<x:Array x:Key="myArray" Type="{x:Type x:Object}">
    <x:Int32>69</x:Int32>
</x:Array>

... and gives the same error message.

@Tommigun1980 Tommigun1980 changed the title [Bug] 4.8-pre3 regression with XAML-defined arrays [Bug] 4.8-pre3 regression with XAML-defined arrays - x:Int32 is no longer of type x:Object Aug 1, 2020
@StephaneDelcroix StephaneDelcroix self-assigned this Aug 1, 2020
@StephaneDelcroix
Copy link
Member

we added additional tests for mismatching types. I'll look into that

@Tommigun1980
Copy link
Author

we added additional tests for mismatching types. I'll look into that

Thank you! I changed my code to use strings only and convert them back to appropriate data types via converters, but it's getting a bit unwieldy.

@StephaneDelcroix StephaneDelcroix added a/Xaml </> a/buildchain 4.8.0 regression on 4.8.0 i/regression and removed s/unverified New report that has yet to be verified labels Aug 2, 2020
StephaneDelcroix added a commit that referenced this issue Aug 3, 2020
Do not return false on CanAdd if all that's required is boxing.

- fixes #11620
@StephaneDelcroix StephaneDelcroix mentioned this issue Aug 3, 2020
2 tasks
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Aug 3, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Aug 3, 2020
@samhouts samhouts added this to the 4.8.0 milestone Aug 4, 2020
@samhouts samhouts moved this from In Progress to Done in vCurrent (4.8.0) Aug 4, 2020
Triage automation moved this from New to Closed Aug 5, 2020
@samhouts samhouts removed this from Closed in Triage Sep 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.8.0 regression on 4.8.0 a/buildchain a/Xaml </> i/regression in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Projects
No open projects
Development

No branches or pull requests

3 participants