mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 20:58:15 +00:00
Use AST nodes as generic arg deduction keys (#982)
This commit is contained in:
1 parent
dcc287cb6e
commit
e65e85b15d
5 files changed
+53
-50
No files matched your search
@@ -241,7 +241,7 @@ void Value::Print(llvm::raw_ostream& out) const {
|
||||
out << "choice " << cast<ChoiceType>(*this).name();
|
||||
break;
|
||||
case Value::Kind::VariableType:
|
||||
out << cast<VariableType>(*this).name();
|
||||
out << cast<VariableType>(*this).binding().name();
|
||||
break;
|
||||
case Value::Kind::ContinuationValue: {
|
||||
out << cast<ContinuationValue>(*this).stack();
|
||||
@@ -348,7 +348,8 @@ auto TypeEqual(Nonnull<const Value*> t1, Nonnull<const Value*> t2) -> bool {
|
||||
case Value::Kind::StringType:
|
||||
return true;
|
||||
case Value::Kind::VariableType:
|
||||
return cast<VariableType>(*t1).name() == cast<VariableType>(*t2).name();
|
||||
return &cast<VariableType>(*t1).binding() ==
|
||||
&cast<VariableType>(*t2).binding();
|
||||
default:
|
||||
FATAL() << "TypeEqual used to compare non-type values\n"
|
||||
<< *t1 << "\n"
|
||||
|
||||
Reference in new issue
Block a user