Fix compiler crash when decorator fn argument contains invalid reference#10858
Draft
Copilot wants to merge 2 commits into
Draft
Fix compiler crash when decorator fn argument contains invalid reference#10858Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…ference When an extern fn is called with an invalid reference as an argument, return errorType instead of the declared return type constraint. This prevents the decorator from being called with an incorrect type and avoids internal compiler crashes. Also skip assignability checks in checkFunctionCallArguments when the resolved argument is errorType to avoid spurious secondary diagnostics. Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix compiler crash for decorator with invalid extern fn reference
Fix compiler crash when decorator fn argument contains invalid reference
Jun 2, 2026
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.
When an
extern fnused as a decorator argument receives an invalid reference (e.g., a typo), the compiler was passing the function's declared return type constraint to the decorator implementation instead of skipping the decorator call. This caused internal crashes in decorator implementations that access properties on the argument.Changes
checkFunctionCall: ReturnerrorTypewhen arguments are unsatisfied outside template declarations, instead of returning the constraint type which passes downstream assignability checkscheckFunctionCallArguments: Skip assignability check when resolved argument iserrorType, preventing spurious secondary diagnostics (only the primaryinvalid-referror is reported)errorTypeinstead of the constraint type when function calls fail due to argument errors