summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-08-10 15:37:19 -0700
committerGitHub <noreply@github.com>2022-08-10 15:37:19 -0700
commita083a37ee58dc48d92cf2b844466a295eb3e643e (patch)
tree69028f3d9f92fa7e2085c76bc234e1949ef645c5 /source/slang/slang-check-expr.cpp
parent88f04c29244af23c1cdd472d8d1ae3e5a650494e (diff)
Add `none` literal that is convertible to `Optional`. (#2356)
* Add `none` literal that is convertible to `Optional`. * Fix cpu code gen. * Include vk and cpu test for is-as operator test. * Inline comparison operators. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 714eba9a3..cb75e3078 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -822,6 +822,12 @@ namespace Slang
return expr;
}
+ Expr* SemanticsExprVisitor::visitNoneLiteralExpr(NoneLiteralExpr* expr)
+ {
+ expr->type = m_astBuilder->getNoneType();
+ return expr;
+ }
+
Expr* SemanticsExprVisitor::visitIntegerLiteralExpr(IntegerLiteralExpr* expr)
{
// The expression might already have a type, determined by its suffix.