diff --git a/executable_semantics/interpreter/interpreter.cpp b/executable_semantics/interpreter/interpreter.cpp index b4cefe206a39..3ac11b178ef0 100644 --- a/executable_semantics/interpreter/interpreter.cpp +++ b/executable_semantics/interpreter/interpreter.cpp @@ -116,8 +116,6 @@ auto CopyVal(const Value* val, int line_num) -> const Value* { return Value::MakeBoolType(); case ValKind::TypeType: return Value::MakeTypeType(); - case ValKind::VarTV: - return Value::MakeVarTypeVal(*val->GetVariableType()); case ValKind::AutoType: return Value::MakeAutoType(); case ValKind::ContinuationType: diff --git a/executable_semantics/interpreter/typecheck.cpp b/executable_semantics/interpreter/typecheck.cpp index 3c2e31116ca7..db4cd83984a6 100644 --- a/executable_semantics/interpreter/typecheck.cpp +++ b/executable_semantics/interpreter/typecheck.cpp @@ -55,8 +55,6 @@ void PrintTypeEnv(TypeEnv types, std::ostream& out) { // Reify type to type expression. auto ReifyType(const Value* t, int line_num) -> const Expression* { switch (t->tag) { - case ValKind::VarTV: - return Expression::MakeIdentifierExpression(0, *t->GetVariableType()); case ValKind::IntType: return Expression::MakeIntTypeLiteral(0); case ValKind::BoolType: diff --git a/executable_semantics/interpreter/value.cpp b/executable_semantics/interpreter/value.cpp index 786f429df3b9..517c07b35c96 100644 --- a/executable_semantics/interpreter/value.cpp +++ b/executable_semantics/interpreter/value.cpp @@ -52,11 +52,6 @@ Address Value::GetPointerValue() const { return u.ptr; } -std::string* Value::GetVariableType() const { - CHECK(tag == ValKind::VarTV); - return u.var_type; -} - BindingPlaceholderValue Value::GetBindingPlaceholderValue() const { CHECK(tag == ValKind::BindingPlaceholderValue); return u.var_pat; @@ -211,13 +206,6 @@ auto Value::MakeBindingPlaceholderValue(std::string name, const Value* type) return v; } -auto Value::MakeVarTypeVal(std::string name) -> const Value* { - auto* v = new Value(); - v->tag = ValKind::VarTV; - v->u.var_type = new std::string(std::move(name)); - return v; -} - auto Value::MakeIntType() -> const Value* { auto* v = new Value(); v->tag = ValKind::IntType; @@ -369,9 +357,6 @@ auto PrintValue(const Value* val, std::ostream& out) -> void { out << " -> "; PrintValue(val->GetFunctionType().ret, out); break; - case ValKind::VarTV: - out << *val->GetVariableType(); - break; case ValKind::StructType: out << "struct " << *val->GetStructType().name; break; @@ -394,8 +379,6 @@ auto TypeEqual(const Value* t1, const Value* t2) -> bool { return false; } switch (t1->tag) { - case ValKind::VarTV: - return *t1->GetVariableType() == *t2->GetVariableType(); case ValKind::PointerType: return TypeEqual(t1->GetPointerType().type, t2->GetPointerType().type); case ValKind::FunctionType: @@ -482,7 +465,6 @@ auto ValueEqual(const Value* v1, const Value* v2, int line_num) -> bool { return FieldsValueEqual(v1->GetTupleValue().elements, v2->GetTupleValue().elements, line_num); default: - case ValKind::VarTV: case ValKind::IntType: case ValKind::BoolType: case ValKind::TypeType: diff --git a/executable_semantics/interpreter/value.h b/executable_semantics/interpreter/value.h index b784c6e4a610..6bca15b2bd52 100644 --- a/executable_semantics/interpreter/value.h +++ b/executable_semantics/interpreter/value.h @@ -44,7 +44,6 @@ enum class ValKind { StructValue, AlternativeValue, TupleValue, - VarTV, IntType, BoolType, TypeType, @@ -140,7 +139,6 @@ struct Value { -> const Value*; static auto MakeBindingPlaceholderValue(std::string name, const Value* type) -> const Value*; - static auto MakeVarTypeVal(std::string name) -> const Value*; static auto MakeIntType() -> const Value*; static auto MakeContinuationType() -> const Value*; static auto MakeAutoType() -> const Value*; @@ -163,7 +161,6 @@ struct Value { AlternativeValue GetAlternativeValue() const; TupleValue GetTupleValue() const; Address GetPointerValue() const; - std::string* GetVariableType() const; BindingPlaceholderValue GetBindingPlaceholderValue() const; FunctionType GetFunctionType() const; PointerType GetPointerType() const; @@ -181,7 +178,6 @@ struct Value { AlternativeValue alt; TupleValue tuple; Address ptr; - std::string* var_type; BindingPlaceholderValue var_pat; FunctionType fun_type; PointerType ptr_type;