mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:24:42 +01:00
@@ -46,7 +46,7 @@ class Value {
|
||||
FunctionType,
|
||||
PointerType,
|
||||
AutoType,
|
||||
StructType,
|
||||
ClassType,
|
||||
ChoiceType,
|
||||
ContinuationType, // The type of a continuation.
|
||||
VariableType, // e.g., generic type parameters.
|
||||
@@ -361,16 +361,16 @@ class AutoType : public Value {
|
||||
};
|
||||
|
||||
// A struct type.
|
||||
class StructType : public Value {
|
||||
class ClassType : public Value {
|
||||
public:
|
||||
StructType(std::string name, VarValues fields, VarValues methods)
|
||||
: Value(Kind::StructType),
|
||||
ClassType(std::string name, VarValues fields, VarValues methods)
|
||||
: Value(Kind::ClassType),
|
||||
name(std::move(name)),
|
||||
fields(std::move(fields)),
|
||||
methods(std::move(methods)) {}
|
||||
|
||||
static auto classof(const Value* value) -> bool {
|
||||
return value->Tag() == Kind::StructType;
|
||||
return value->Tag() == Kind::ClassType;
|
||||
}
|
||||
|
||||
auto Name() const -> const std::string& { return name; }
|
||||
|
||||
Reference in New Issue
Block a user