summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-mangle.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-06-02 15:31:03 -0700
committerGitHub <noreply@github.com>2023-06-02 15:31:03 -0700
commitc3c1b56ae693ed23804544e929a3447bc921edf6 (patch)
treef1d8f81a42f094729d7091cddd5622b1ff25071b /source/slang/slang-mangle.cpp
parent16cd361dd67471bcc355d1b3b72b0b022518088f (diff)
Fix generic param inference through TypeCastIntVal. (#2916)
Diffstat (limited to 'source/slang/slang-mangle.cpp')
-rw-r--r--source/slang/slang-mangle.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp
index ef9bf4938..3b0d12da8 100644
--- a/source/slang/slang-mangle.cpp
+++ b/source/slang/slang-mangle.cpp
@@ -326,6 +326,24 @@ namespace Slang
else if (const auto polynomialIntVal = dynamicCast<PolynomialIntVal>(val))
{
emitRaw(context, "KX");
+ emit(context, (UInt)polynomialIntVal->constantTerm);
+ emit(context, (UInt)polynomialIntVal->terms.getCount());
+ for (auto term : polynomialIntVal->terms)
+ {
+ emit(context, (UInt)term->constFactor);
+ emit(context, (UInt)term->paramFactors.getCount());
+ for (auto factor : term->paramFactors)
+ {
+ emitVal(context, factor->param);
+ emit(context, (UInt)factor->power);
+ }
+ }
+ }
+ else if (const auto typecastIntVal = dynamicCast<TypeCastIntVal>(val))
+ {
+ emitRaw(context, "KK");
+ emitVal(context, typecastIntVal->type);
+ emitVal(context, typecastIntVal->base);
}
else
{