summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 3b308c46a..ff469428b 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -1509,6 +1509,26 @@ namespace Slang
return expr;
}
+ Expr* SemanticsExprVisitor::visitJVPDerivativeOfExpr(JVPDerivativeOfExpr* expr)
+ {
+ // Check/Resolve inner function declaration.
+ expr->baseFn = CheckTerm(expr->baseFn);
+
+ if(auto funcType = as<FuncType>(expr->baseFn->type))
+ {
+ // Resolve JVP type here.
+ // Temporarily resolving to the same type as the original function.
+ expr->type = expr->baseFn->type;
+ }
+ else
+ {
+ // Error
+ UNREACHABLE_RETURN(nullptr);
+ }
+
+ return expr;
+ }
+
Expr* SemanticsExprVisitor::visitTypeCastExpr(TypeCastExpr * expr)
{
// Check the term we are applying first