diff options
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
| -rw-r--r-- | source/slang/slang-check-expr.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp index 8e14af72a..e33d26c0c 100644 --- a/source/slang/slang-check-expr.cpp +++ b/source/slang/slang-check-expr.cpp @@ -982,7 +982,7 @@ namespace Slang || opName == getName("|") || opName == getName("&") || opName == getName("^") || opName == getName("~") || opName == getName("%") || opName == getName("?:") || opName == getName("<<") || opName == getName(">>")) { - auto result = m_astBuilder->create<SomeIntVal>(); + auto result = m_astBuilder->create<FuncCallIntVal>(); result->args.addRange(argVals, argCount); result->funcDeclRef = funcDeclRef; result->funcType = as<Type>(funcDeclRefExpr.getExpr()->type->substitute( @@ -1131,6 +1131,22 @@ namespace Slang if(!decl->hasModifier<ConstModifier>()) return nullptr; + if (isInterfaceRequirement(decl)) + { + for (auto subst = declRef.substitutions.substitutions; subst; subst = subst->outer) + { + if (auto thisTypeSubst = as<ThisTypeSubstitution>(subst)) + { + auto val = WitnessLookupIntVal::tryFold( + m_astBuilder, + thisTypeSubst->witness, + decl, + declRef.substitute(m_astBuilder, decl->type.type)); + return as<IntVal>(val); + } + } + } + auto initExpr = getInitExpr(m_astBuilder, declRef); if(!initExpr) return nullptr; |
