From b0dfb1aef2cd5483f59b858c8921707174ffdf2d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 Dec 2024 03:49:25 -0800 Subject: Don't emit a warning when implicit casting from known in-range int lit to half. (#5814) Co-authored-by: Ellie Hermaszewska --- source/slang/slang-check-conversion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/slang-check-conversion.cpp') diff --git a/source/slang/slang-check-conversion.cpp b/source/slang/slang-check-conversion.cpp index 0c06fb113..74151a4bb 100644 --- a/source/slang/slang-check-conversion.cpp +++ b/source/slang/slang-check-conversion.cpp @@ -1327,7 +1327,7 @@ bool SemanticsVisitor::_coerce( // For general types of implicit conversions, we issue a warning, unless `fromExpr` // is a known constant and we know it won't cause a problem. bool shouldEmitGeneralWarning = true; - if (isScalarIntegerType(toType)) + if (isScalarIntegerType(toType) || isHalfType(toType)) { if (auto intVal = tryFoldIntegerConstantExpression( fromExpr, -- cgit v1.2.3