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

Nullable: all calendars #23469

Merged
merged 3 commits into from
Mar 27, 2019
Merged

Nullable: all calendars #23469

merged 3 commits into from
Mar 27, 2019

Conversation

krwq
Copy link
Member

@krwq krwq commented Mar 26, 2019

No description provided.

@@ -54,9 +55,9 @@ private static string GetJapaneseEnglishEraName(int era)
return era <= s_JapaneseErasEnglishNames.Length ? s_JapaneseErasEnglishNames[era - 1] : " ";
}

private static bool GetJapaneseEraInfo(int era, out DateTimeOffset dateOffset, out string eraName, out string abbreviatedEraName)
private static bool GetJapaneseEraInfo(int era, out DateTimeOffset dateOffset, out string? eraName, out string? abbreviatedEraName)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not 100% sure about this ones.

@tarekgh do you know if these out string parameters can be null?

Copy link
Member

Choose a reason for hiding this comment

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

The method will return false if we couldn't get non null strings.

Copy link
Member

Choose a reason for hiding this comment

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

@krwq what happen if one of these strings is null?

Copy link
Member Author

Choose a reason for hiding this comment

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

if (!GetJapaneseEraInfo(i, out dateOffset, out eraName, out abbreviatedEraName))
{
return null;
}

assuming we return false on failure we are good - if API returns true AND null as one of the strings then it will be populated to EraInfo constructor

Copy link
Member

Choose a reason for hiding this comment

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

Then those 2 values in the call site should be nullable. I guess that could break the corert build

Copy link
Member Author

Choose a reason for hiding this comment

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

actually this is my bad - forgot the private CI doesn't build core rt

Copy link
Member

Choose a reason for hiding this comment

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

Oh I thought you actually built corert with this changes locally. Might be worth doing it just to make sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

can we add it to CI?

Copy link
Member

Choose a reason for hiding this comment

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

It is not trivial. I don’t think it is worth spending a day on adding it. If we see it starts causing pain then we can invest in it.

Copy link
Member Author

Choose a reason for hiding this comment

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

im not sure how to build corert locally as well - we can fix any errors on the main PR since we have CI in there - there is very little CoreRT changes

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

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

Rather than one question. It looks good to me.

cc: @stephentoub

@krwq krwq merged commit 55705f5 into dotnet:NullableFeature Mar 27, 2019
safern pushed a commit that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error
safern pushed a commit that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error
safern pushed a commit that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/mono that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corert that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
marek-safar pushed a commit to mono/mono that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
danmoseley pushed a commit to dotnet/corefx that referenced this pull request Mar 28, 2019
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
jkotas pushed a commit to dotnet/corert that referenced this pull request Mar 29, 2019
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* calendar

* nullable: all calendars

* fix likely corert error


Commit migrated from dotnet/coreclr@bbcfd3a
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* calendar

* nullable: all calendars

* fix likely corert error


Commit migrated from dotnet/coreclr@90f5615
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.

4 participants