Skip to content

Conversation

@josephmyers
Copy link
Collaborator

@josephmyers josephmyers commented Feb 28, 2025

This change is Reviewable

@github-actions
Copy link

github-actions bot commented Mar 6, 2025

LCM Tests

    16 files  ±0      16 suites  ±0   2m 48s ⏱️ +2s
 2 830 tests ±0   2 810 ✅ ±0   20 💤 ±0  0 ❌ ±0 
11 268 runs  ±0  11 089 ✅ ±0  179 💤 ±0  0 ❌ ±0 

Results for commit 482bc56. ± Comparison against base commit c0eb609.

♻️ This comment has been updated with latest results.

@josephmyers josephmyers marked this pull request as ready for review March 6, 2025 07:46
@josephmyers josephmyers requested a review from hahn-kev March 6, 2025 07:48
I'm not sure how these didn't show up beforehand.
Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

left some comments

m_ungot = top.m_value;
Pop(ref top,((ParserReduce)pe).m_depth,er);
newtop.pos = top.m_value.pos;
newtop!.pos = top.m_value.pos;
Copy link
Contributor

Choose a reason for hiding this comment

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

wont this throw if pe.m_action is null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it will. The way I interpret this section is, "if pe is non-null, so is pe.m_action"

for (;;)
{
string cnm = top.m_value.yyname();
string cnm = top.m_value!.yyname();
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be null because top is reassigned in the call to Pop(ref top ... meaning m_value could be null here. I say we just explicitly throw a null error before this line if top.m_value is null as that's what it would have done before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But it returns after that call. It shouldn't ever do another iteration in this loop if it gets the successful parse. Right?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh you're right, man this code is just confusing. I'd still be inclined to throw as that's always going to be a better error then what gets thrown automatically, and then it's obvious to anyone looking at the code what will happen if it's null here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good

Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

left some more comments

MergeRedundantEntries(leDup, le);
List<WsString> delKeys = new List<WsString>();
foreach (var x in m_mapFormEntry)
foreach (var x in m_mapFormEntry!)
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be removed if we annotate FillEntryMap with [MemberNotNull(nameof(m_mapFormEntry))] which indicates that calling this method will make the field not null

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oddly enough, this required me to upgrade to C# 9. I would've thought it wouldn't matter if we're using the Nullable package?

@josephmyers josephmyers requested a review from hahn-kev March 14, 2025 03:50
break;
case CellarPropertyType.Integer:
int val = sda.get_IntProp(cmoOld.Hvo, flid);
int val = sda!.get_IntProp(cmoOld.Hvo, flid);
Copy link
Contributor

Choose a reason for hiding this comment

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

now that you're throwing when sda is null I don't think you need ! here or any of the other lines below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

looks good to me, I think there's still a couple comments to resolve. I left 2 comments about weird indenting in the test projects but they're all weird.

@josephmyers
Copy link
Collaborator Author

@hahn-kev I think I got everything. Thanks for approving

@josephmyers josephmyers enabled auto-merge (squash) March 20, 2025 07:45
@josephmyers josephmyers merged commit 1e26e88 into master Mar 20, 2025
3 of 4 checks passed
@josephmyers josephmyers deleted the nrt-migration branch March 20, 2025 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants