fix SIGSEGV on missing method dispatch (issue 9389)#9394
Open
imclerran wants to merge 1 commit intoroc-lang:mainfrom
Open
fix SIGSEGV on missing method dispatch (issue 9389)#9394imclerran wants to merge 1 commit intoroc-lang:mainfrom
imclerran wants to merge 1 commit intoroc-lang:mainfrom
Conversation
`roc test` rendered compilation diagnostics and then proceeded into
monomorphization regardless. When the type-checker reported MISSING
METHOD or UNDEFINED VARIABLE, the dispatch resolver hit an `unreachable`
in release (SIGSEGV) or `std.debug.panic` in debug. The `has_compilation_errors`
flag was being computed but only consulted at the end for cache outcome.
Bail in `rocTest` after rendering reports if any are fatal/runtime_error,
matching `roc check`'s behavior.
Also fix `test/cli/issue8699.roc`, which was missing `main!` and had been
relying on the prior overlenient behavior to run tests despite the compile
error. Added `main! = |_| {}` so the fixture compiles cleanly; the test's
intent (verify nested-list operations don't panic) is unchanged.
Add CLI integration test `roc test does not panic on missing method` plus
fixture `test/cli/MissingMethodDoesNotPanic.roc` to prevent regression.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fedaed3 to
f298327
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for issue #9389.
roc testrendered compilation diagnostics and then proceeded into monomorphization regardless. When the type-checker reported MISSING METHOD or UNDEFINED VARIABLE, the dispatch resolver hit anunreachablein release (SIGSEGV) orstd.debug.panicin debug. Thehas_compilation_errorsflag was being computed but only consulted at the end for cache outcome.Bail in
rocTestafter rendering reports if any are fatal/runtime_error, matchingroc check's behavior.Also fix
test/cli/issue8699.roc, which was missingmain!and had been relying on the prior overlenient behavior to run tests despite the compile error. Addedmain! = |_| {}so the fixture compiles cleanly; the test's intent (verify nested-list operations don't panic) is unchanged.Add CLI integration test
roc test does not panic on missing methodplus fixturetest/cli/MissingMethodDoesNotPanic.rocto prevent regression.