Use AST nodes as generic arg deduction keys (#982)

This commit is contained in:
Geoff Romer
2021-12-10 12:19:06 -08:00
committed by GitHub
parent dcc287cb6e
commit e65e85b15d
5 changed files with 53 additions and 50 deletions
+4 -4
View File
@@ -467,17 +467,17 @@ class ContinuationType : public Value {
// A variable type.
class VariableType : public Value {
public:
explicit VariableType(std::string name)
: Value(Kind::VariableType), name_(std::move(name)) {}
explicit VariableType(Nonnull<const GenericBinding*> binding)
: Value(Kind::VariableType), binding_(binding) {}
static auto classof(const Value* value) -> bool {
return value->kind() == Kind::VariableType;
}
auto name() const -> const std::string& { return name_; }
auto binding() const -> const GenericBinding& { return *binding_; }
private:
std::string name_;
Nonnull<const GenericBinding*> binding_;
};
// A first-class continuation representation of a fragment of the stack.