IAP 4.6.0 -> Unnecessary usage of nullable operator on nullable types

Hello!

As per the title, can Unity please reconsider (what appears to be) a new trend of using the nullable operator (?) on nullable types.

I see this usage on the two breaking changes introduced in 4.6.0…

void OnInitializeFailed(InitializationFailureReason error, string? message);
void RestoreTransactions(Action<bool, string?>? callback);

It’s a non-standard thing to-do as strings & objects are already nullable types, so the operator is not required.

In-fact specifying the operator will likely cause confusion (and warnings if replicated in client code) for those less experienced with C#

No operators will work in exactly the same manner…

void OnInitializeFailed(InitializationFailureReason error, string message);
void RestoreTransactions(Action<bool, string> callback);

Thank you.

Thank you for your feedback PeachyPixels!

The team has discussed this and we will make sure not to expose any nullable going forward.
The existing ones will be changed in our next release.

1 Like

[quote=“Yannick_D, post:2, topic: 912111, username:Yannick_D”]
The team has discussed this and we will make sure not to expose any nullable going forward.
The existing ones will be changed in our next release.
[/quote]Thanks @Yannick_D it’s much appreciated.

Could you also please consider removing the old (obsolete) method as well?

[Obsolete]
void OnInitializeFailed(InitializationFailureReason error);

The 4.6.0 update included breaking changes to the interface (contract) so required developer input\changes anyway.

There is now an obsolete method hanging around that is not being called\used (from what I can gather)

Thanks again for the update.

1 Like

Some methods were marked as [Obsolete] in 4.6.0 because we were trying to avoid causing a breaking change…

We will be removing them in the next major release to avoid causing more breaking changes until then!

1 Like