Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Making BaseNumberConverter Internal#37278

Merged
Anipik merged 3 commits intodotnet:masterfrom
Anipik:baseNumberConverter
Apr 29, 2019
Merged

Making BaseNumberConverter Internal#37278
Anipik merged 3 commits intodotnet:masterfrom
Anipik:baseNumberConverter

Conversation

@Anipik
Copy link
Copy Markdown

@Anipik Anipik commented Apr 29, 2019

Related to https://github.com/dotnet/corefx/issues/35924

Technically it is a breaking change but there is no way to derive and instantiate this class. An exception will get thrown if we will try to instantiate the derived class.

I am making this internal and not private because a bunch of classes are deriving it.

I will also make a change a arcade repo to help avoid these scenarios

@Anipik Anipik requested review from danmoseley, ericstj and jkotas April 29, 2019 19:28
@Anipik Anipik merged commit fe807da into dotnet:master Apr 29, 2019
@Anipik Anipik deleted the baseNumberConverter branch April 29, 2019 22:27
MembersMustExist : Member 'System.Security.Cryptography.Pkcs.CmsSigner.SignedAttributes.set(System.Security.Cryptography.CryptographicAttributeObjectCollection)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Security.Cryptography.Pkcs.CmsSigner.UnsignedAttributes.set(System.Security.Cryptography.CryptographicAttributeObjectCollection)' does not exist in the implementation but it does exist in the contract.
Total Issues: 21
Compat issues with assembly System.ComponentModel.TypeConverter:
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.

@terrajobst we should fix this in the standard repo as well.

@karelz karelz added this to the 3.0 milestone May 4, 2019
jonpryor added a commit to xamarin/xamarin-android-api-compatibility that referenced this pull request Jun 12, 2019
Context: https://github.com/dotnet/corefx/issues/35924
Context: dotnet/corefx#37278
Context: dotnet/standard#1171
Context: dotnet/android@ce4eeb4
Context: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/561/API_20Compatibility_20Checks/

Commit xamarin/xamarin-android/master@ce4eeb4f introduced API breakage
within `System.dll`: the
[`System.ComponentModel.BaseNumberConverter` default constructor][0]
was ***removed***:

	<h3>Type Changed: System.ComponentModel.BaseNumberConverter</h3>
	<p>Removed constructor:</p>
	<pre>
	  <span class='removed removed-constructor breaking' data-is-breaking>protected BaseNumberConverter ();</span>
	</pre>

On the surface this looks like a questionable API break.  However,
consider the [`BaseNumberConverter` source code][1], which contains
`internal abstract` members:

	partial abstract class BaseNumberConverter {
	  internal abstract Type TargetType { get; }
	  internal abstract object FromString(string value, int radix);
	  // ...
	}

The existence of these `internal abstract` members means that the type
cannot possibly be inherited by a non-`abstract` class, nor can such a
subclass be instantiated via `new` expression.  This in turn means
that the "breakage" of removing the default constructor is
non- existent; it cannot possibly break existing code.

Remove the `BaseNumberConverter` default constructor, so that we no
longer flag it as API breakage.

[0]: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.basenumberconverter.-ctor?view=netframework-4.8#System_ComponentModel_BaseNumberConverter__ctor
[1]: https://github.com/dotnet/corefx/blob/master/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/BaseNumberConverter.cs
jonpryor added a commit to xamarin/xamarin-android-api-compatibility that referenced this pull request Jun 13, 2019
Context: https://github.com/dotnet/corefx/issues/35924
Context: dotnet/corefx#37278
Context: dotnet/standard#1171
Context: dotnet/android@ce4eeb4
Context: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/561/API_20Compatibility_20Checks/

Commit xamarin/xamarin-android/master@ce4eeb4f introduced API breakage
within `System.dll`: the
[`System.ComponentModel.BaseNumberConverter` default constructor][0]
was ***removed***:

	<h3>Type Changed: System.ComponentModel.BaseNumberConverter</h3>
	<p>Removed constructor:</p>
	<pre>
	  <span class='removed removed-constructor breaking' data-is-breaking>protected BaseNumberConverter ();</span>
	</pre>

On the surface this looks like a questionable API break.  However,
consider the [`BaseNumberConverter` source code][1], which contains
`internal abstract` members:

	partial abstract class BaseNumberConverter {
	  internal abstract Type TargetType { get; }
	  internal abstract object FromString(string value, int radix);
	  // ...
	}

The existence of these `internal abstract` members means that the type
cannot possibly be inherited by a non-`abstract` class, nor can such a
subclass be instantiated via `new` expression.  This in turn means
that the "breakage" of removing the default constructor is
non- existent; it cannot possibly break existing code.

Remove the `BaseNumberConverter` default constructor, so that we no
longer flag it as API breakage.

[0]: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.basenumberconverter.-ctor?view=netframework-4.8#System_ComponentModel_BaseNumberConverter__ctor
[1]: https://github.com/dotnet/corefx/blob/master/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/BaseNumberConverter.cs
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* type converter ctor made internal

* diasabling apicompat for the change

* Fixing uap app compat


Commit migrated from dotnet/corefx@fe807da
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants