From bc6bc56db51d06b92dc63ef9c9e0def6c9760c9e Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 1 Jun 2022 22:29:10 -0700 Subject: Clean up void returns. (#2260) * Clean up `IRReturnVoid`. * Update gitignore. Co-authored-by: Yong He --- source/slang/slang-check-expr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-check-expr.cpp') diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp index 4b29de1bf..8a80398e9 100644 --- a/source/slang/slang-check-expr.cpp +++ b/source/slang/slang-check-expr.cpp @@ -1337,7 +1337,7 @@ namespace Slang // if this is still an invoke expression, test arguments passed to inout/out parameter are LValues if(auto funcType = as(invoke->functionExpr->type)) { - if (!funcType->errorType->equals(m_astBuilder->getVoidType())) + if (!funcType->errorType->equals(m_astBuilder->getBottomType())) { // If the callee throws, make sure we are inside a try clause. if (m_enclosingTryClauseType == TryClauseType::None) @@ -1556,7 +1556,7 @@ namespace Slang getSink()->diagnose(expr, Diagnostics::uncaughtTryCallInNonThrowFunc); return expr; } - if (parentFunc->errorType->equals(m_astBuilder->getVoidType())) + if (parentFunc->errorType->equals(m_astBuilder->getBottomType())) { getSink()->diagnose(expr, Diagnostics::uncaughtTryCallInNonThrowFunc); return expr; @@ -1571,7 +1571,7 @@ namespace Slang { if (auto funcCallee = as(callee->declRef.getDecl())) { - if (funcCallee->errorType->equals(m_astBuilder->getVoidType())) + if (funcCallee->errorType->equals(m_astBuilder->getBottomType())) { getSink()->diagnose(expr, Diagnostics::tryInvokeCalleeShouldThrow, callee->declRef); } -- cgit v1.2.3