Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Jan 24, 2025
1 parent 4b9f66c commit 554a946
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/kind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ std::string kindToTerm(Kind k)
case Kind::LAMBDA: ss << "lambda"; break;
case Kind::PROGRAM: ss << "program"; break;
case Kind::AS: ss << "eo::as"; break;
case Kind::AS_RETURN: ss << "as"; break;
case Kind::PARAMETERIZED: ss << "eo::_"; break;
// operations on literals
default:
Expand Down
7 changes: 4 additions & 3 deletions src/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,13 @@ Expr State::mkExpr(Kind k, const std::vector<Expr>& children)
Trace("overload") << "...type arg for ambiguous constructor" << std::endl;
return mkExpr(Kind::APPLY_OPAQUE, {children[0], children[1]});
}
// note we don't support other uses of `as` for symbol disambiguation yet
// note we don't support other uses of `as` for symbol disambiguation yet,
// we fallthrough and construct the bogus term of kind AS_RETURN.
}
else if (k==Kind::AS)
{
// if it has 2 children, process it, otherwise we make the bogus term
// below
// if it has 2 children, process it, otherwise we make the bogus term of
// kind AS below
if (vchildren.size()==2)
{
Trace("overload") << "process eo::as " << children[0] << " " << children[1] << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion src/type_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@ Expr TypeChecker::getTypeInternal(ExprValue* e, std::ostream* out)
}
break;
case Kind::AS:
case Kind::AS_RETURN:
{
// constructing an application of AS means the type was incorrect.
if (out)
{
(*out) << "Encountered bad type for eo::as";
(*out) << "Encountered bad type for " << kindToTerm(k);
}
return d_null;
}
Expand Down

0 comments on commit 554a946

Please sign in to comment.