summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-04-13 16:40:36 -0700
committerGitHub <noreply@github.com>2023-04-13 16:40:36 -0700
commit3bbac5f16e9dd47acd2132c0bb2a43393831c450 (patch)
treebddf137c252c164f7cd08f1f58b559b96ee49419 /source/slang/slang-check-stmt.cpp
parent3b4a50d74059a26af2ed8c37fb2042f33ba7cf2c (diff)
Warn on float-to-double coercion for arguments. (#2802)
* Warn on float-to-double coercion for arguments. * Fix test. * Rename. * Fixup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index 6efc3e52e..b2830febe 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -157,7 +157,7 @@ namespace Slang
}
Expr* e = expr;
e = CheckTerm(e);
- e = coerce(m_astBuilder->getBoolType(), e);
+ e = coerce(CoercionSite::General, m_astBuilder->getBoolType(), e);
return e;
}
@@ -313,7 +313,7 @@ namespace Slang
{
if (function)
{
- stmt->expression = coerce(function->returnType.Ptr(), stmt->expression);
+ stmt->expression = coerce(CoercionSite::Return, function->returnType.Ptr(), stmt->expression);
}
else
{