summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-06-01 22:29:10 -0700
committerGitHub <noreply@github.com>2022-06-01 22:29:10 -0700
commitbc6bc56db51d06b92dc63ef9c9e0def6c9760c9e (patch)
tree55aae1b64e3c0befe4b424764f6f0064701a9ffe /source/slang/slang-check-expr.cpp
parent4f14efc9752d9ebc8538a2e29ed154a00dc99682 (diff)
Clean up void returns. (#2260)
* Clean up `IRReturnVoid`. * Update gitignore. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp6
1 files changed, 3 insertions, 3 deletions
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<FuncType>(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<FuncDecl>(callee->declRef.getDecl()))
{
- if (funcCallee->errorType->equals(m_astBuilder->getVoidType()))
+ if (funcCallee->errorType->equals(m_astBuilder->getBottomType()))
{
getSink()->diagnose(expr, Diagnostics::tryInvokeCalleeShouldThrow, callee->declRef);
}