mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 08:51:04 +01:00
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:
co-authored by
Geoff Romer
parent
1c09de9b87
commit
80529aaef9
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user