Skip to content

Make ComponentModel intrinsic TypeConverters linker-safe - #39973

Merged
layomia merged 8 commits into
dotnet:masterfrom
layomia:converters
Aug 7, 2020
Merged

Make ComponentModel intrinsic TypeConverters linker-safe#39973
layomia merged 8 commits into
dotnet:masterfrom
layomia:converters

Conversation

@layomia

@layomia layomia commented Jul 27, 2020

Copy link
Copy Markdown
Contributor

Fixes #38582

@layomia layomia added this to the 5.0.0 milestone Jul 27, 2020
@layomia layomia self-assigned this Jul 27, 2020
@ghost

ghost commented Jul 27, 2020

Copy link
Copy Markdown

Tagging subscribers to this area: @safern
See info in area-owners.md if you want to be subscribed.

@eerhardt

Copy link
Copy Markdown
Member

Can we add a couple tests for this?

@eerhardt

eerhardt commented Aug 6, 2020

Copy link
Copy Markdown
Member
            // Special case converters

Since this method is only used for editors now, can we:

  1. Rename the method to be symmetric with GetIntrinsicTypeConverter? e.g. GetIntrinsicTypeEditor
  2. Remove the Special case converters code.

Refers to: src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs:1336 in 072efce. [](commit_id = 072efce, deletion_comment = False)

@eerhardt eerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for getting this taken care of. This should eliminate the need for the LinkerWorkaround.xml in Blazor now.

@layomia
layomia merged commit 2d160e4 into dotnet:master Aug 7, 2020
@layomia
layomia deleted the converters branch August 7, 2020 00:35
Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
* Make ComponentModel intrinsic TypeConverters linker-safe

* Avoid reflection in converter func lookup

* Re-add code path that supports editors

* Consolidate intrinsic converter caches, move converter-specific code to new method, add trimming tests

* Address feedback

* Revert change to GetIntrinsicTypeEditor method

* Handle inheritance with Uri and CultureInfo types

* Add heirarchy-related comments to cache docs
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Aug 27, 2020
It tests internal implementation details, and those details have now changed
(dotnet/runtime#39973). So just skip the entire test
for now.

Fixes this test failure:

    DontLink.CommonDontLinkTest
        [FAIL] TypeDescriptorCanary : System.InvalidCastException : Specified cast is not valid. :    at DontLink.CommonDontLinkTest.TypeDescriptorCanary() in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/linker/CommonDontLinkTest.cs:line 22
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
rolfbjarne added a commit to dotnet/macios that referenced this pull request Aug 27, 2020
It tests internal implementation details, and those details have now changed
(dotnet/runtime#39973). So just skip the entire test
for now.

Fixes this test failure:

    DontLink.CommonDontLinkTest
        [FAIL] TypeDescriptorCanary : System.InvalidCastException : Specified cast is not valid. :    at DontLink.CommonDontLinkTest.TypeDescriptorCanary() in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/linker/CommonDontLinkTest.cs:line 22
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComponentModel IntrinsicTypeConverters are not linker safe

4 participants