mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 11:21:05 +01:00
Add support for _ placeholder. (#661)
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
co-authored by
Jon Meow
parent
c3c89a77a4
commit
def98d1182
@@ -110,7 +110,8 @@ struct TupleValue {
|
||||
|
||||
struct BindingPlaceholderValue {
|
||||
static constexpr ValKind Kind = ValKind::BindingPlaceholderValue;
|
||||
std::string name;
|
||||
// nullopt represents the `_` placeholder
|
||||
std::optional<std::string> name;
|
||||
const Value* type;
|
||||
};
|
||||
|
||||
@@ -183,8 +184,8 @@ struct Value {
|
||||
static auto MakeAlternativeConstructorValue(std::string alt_name,
|
||||
std::string choice_name)
|
||||
-> const Value*;
|
||||
static auto MakeBindingPlaceholderValue(std::string name, const Value* type)
|
||||
-> const Value*;
|
||||
static auto MakeBindingPlaceholderValue(std::optional<std::string> name,
|
||||
const Value* type) -> const Value*;
|
||||
static auto MakeIntType() -> const Value*;
|
||||
static auto MakeContinuationType() -> const Value*;
|
||||
static auto MakeAutoType() -> const Value*;
|
||||
|
||||
Reference in New Issue
Block a user