From a083a37ee58dc48d92cf2b844466a295eb3e643e Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 10 Aug 2022 15:37:19 -0700 Subject: 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 --- source/slang/slang-check-expr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-check-expr.cpp') 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. -- cgit v1.2.3