Parameterized impl declarations (#1189)

* parameterized impls, first step

* bug fixes, comments, etc.

* added another test case, fix a bug in impl lookup

* simplify tests, removing tuple stuff

* don't create impl bindings for -bound implicit parameters

* remove a redundant 'private'

* CamelCase

* add missing backtick

* add a comment
This commit is contained in:
Jeremy G. Siek
2022-04-20 10:18:01 -04:00
committed by GitHub
parent 958fb8e529
commit b784458aef
20 changed files with 893 additions and 386 deletions
+6
View File
@@ -164,6 +164,11 @@ void Expression::Print(llvm::raw_ostream& out) const {
<< if_expr.then_expression() << " else " << if_expr.else_expression();
break;
}
case ExpressionKind::InstantiateImpl: {
const auto& inst_impl = cast<InstantiateImpl>(*this);
out << "instantiate " << *inst_impl.generic_impl();
break;
}
case ExpressionKind::UnimplementedExpression: {
const auto& unimplemented = cast<UnimplementedExpression>(*this);
out << "UnimplementedExpression<" << unimplemented.label() << ">(";
@@ -237,6 +242,7 @@ void Expression::PrintID(llvm::raw_ostream& out) const {
case ExpressionKind::UnimplementedExpression:
case ExpressionKind::FunctionTypeLiteral:
case ExpressionKind::ArrayTypeLiteral:
case ExpressionKind::InstantiateImpl:
out << "...";
break;
}