summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-02-11 13:57:35 +0800
committerGitHub <noreply@github.com>2023-02-11 13:57:35 +0800
commit94b2c676662ef581b5de3baa6cde076fe07ef26b (patch)
tree8ee9bda481e9786ed05322deb72e9f65df11b249 /source/slang/slang-check-expr.cpp
parentc7f486c57cec2aae901dec6123fc57dfb5133f46 (diff)
Take into account existing initializer list type when performing coercions (#2641)
Fixes https://github.com/shader-slang/slang/issues/2189
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 7d546e60b..75a3c2ff1 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -2474,7 +2474,7 @@ namespace Slang
auto funcExpr = expr->functionExpr;
funcExpr = CheckTerm(funcExpr);
- // Now ensure that the term represnets a (proper) type.
+ // Now ensure that the term represents a (proper) type.
TypeExp typeExp;
typeExp.exp = funcExpr;
typeExp = CheckProperType(typeExp);
@@ -2544,6 +2544,7 @@ namespace Slang
// make this a major concern (since they aren't supported in HLSL).
//
InitializerListExpr* initListExpr = m_astBuilder->create<InitializerListExpr>();
+ initListExpr->loc = expr->loc;
auto checkedInitListExpr = visitInitializerListExpr(initListExpr);
return coerce(typeExp.type, checkedInitListExpr);