Skip to content

Fix: No new resolver crash with partially resolved datatype update expressions#5440

Merged
MikaelMayer merged 25 commits into
masterfrom
fix-5331-internal-error-system-nullreferenceexception
Jun 14, 2024
Merged

Fix: No new resolver crash with partially resolved datatype update expressions#5440
MikaelMayer merged 25 commits into
masterfrom
fix-5331-internal-error-system-nullreferenceexception

Conversation

@MikaelMayer

@MikaelMayer MikaelMayer commented May 14, 2024

Copy link
Copy Markdown
Member

Fixes #5331
Fixes #5365

The only part that fixes the issue is the last line end of the file PreTypeResolve.Expressions.cs, the rest is an automated conversion If/then/else to a switch statement that helped debugging and makes the code easier to maintain.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@MikaelMayer MikaelMayer requested a review from RustanLeino May 14, 2024 17:44
@MikaelMayer MikaelMayer self-assigned this May 14, 2024
@MikaelMayer MikaelMayer enabled auto-merge (squash) May 23, 2024 16:14
RustanLeino
RustanLeino previously approved these changes May 23, 2024

@RustanLeino RustanLeino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The fix itself looks good. For the if/switch refactoring, I only did a quick scan.

Comment on lines +4 to +8
datatype S = S(
n:nat
) {
function f():S { this }
function g():S { this.(n := 0).f() }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file contains the failing test in Issue #5365, right? If so, should the name of the file reflect this?

RustanLeino
RustanLeino previously approved these changes May 24, 2024
RustanLeino and others added 3 commits May 24, 2024 15:19
@MikaelMayer MikaelMayer merged commit 5f74d6a into master Jun 14, 2024
@MikaelMayer MikaelMayer deleted the fix-5331-internal-error-system-nullreferenceexception branch June 14, 2024 15:52
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.

internal error: function call on datatype with updated member Internal Error: System.NullReferenceException

2 participants