From 3bbac5f16e9dd47acd2132c0bb2a43393831c450 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 13 Apr 2023 16:40:36 -0700 Subject: 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 --- source/slang/slang-check-stmt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-check-stmt.cpp') 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 { -- cgit v1.2.3