Convert the scrutinee of a binding pattern to the right category. (#5662)

When the binding pattern appears within a `var` pattern, convert to a
reference. Otherwise, convert to a value.

This gets the advent of code examples to produce the right answers again
:)

---------

Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
Richard Smith
2025-06-17 16:45:19 +00:00
committed by GitHub
co-authored by Geoff Romer
parent 1c09de9b87
commit 80529aaef9
29 changed files with 317 additions and 260 deletions
+7
View File
@@ -51,6 +51,13 @@ constexpr Kind UntestedKinds[] = {
// - Require all diagnostics produced by compiling have their first location
// be in the file being compiled, never an import.
Kind::LanguageServerDiagnosticInWrongFile,
// TODO: This can only fire if we attempt to convert a non-reference
// expression to a durable reference binding. At the moment, the only time
// we attempt reference binding is within a `var` pattern, where the
// conversion cannot fail. This should be covered once we support `ref`
// binding syntax.
Kind::ConversionFailureNonRefToRef,
};
// Looks for diagnostic kinds that aren't covered by a file_test.