summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-10-03 16:02:16 -0400
committerGitHub <noreply@github.com>2024-10-03 16:02:16 -0400
commit9f246a43667b4893040669873400e2e3813328ff (patch)
treef1fafe8c266b1db6f5f2cb76ab4fb7332cc2be54 /source/slang/slang-check-expr.cpp
parentaa64c853142076b17bd020f1386ea5fc6fcd5e3e (diff)
Support custom derivatives of member functions of differentiable types (#5124)
* Initial work to support custom derivatives for member methods of differentiable types * Support custom derivatives of member functions of differentiable types - Also adds support for declaring custom derivatives via extensions. * Fix * move defs * Update slang-check-decl.cpp * Create diff-member-func-custom-derivative.slang.expected.txt * Update slang-check-decl.cpp * Fix for static custom derivatives * Fix diagnostics for [PreferRecompute] * Add backward custom derivative tests
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index e9c257750..842ffb527 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -4754,7 +4754,9 @@ namespace Slang
scope = scope->parent;
}
- getSink()->diagnose(expr, Diagnostics::thisExpressionOutsideOfTypeDecl);
+ if (auto sink = getSink())
+ sink->diagnose(expr, Diagnostics::thisExpressionOutsideOfTypeDecl);
+
return CreateErrorExpr(expr);
}