From bb017e6aa8ddbfac6b9a78a66f4706964fbeaff4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 4 Mar 2024 21:57:50 -0800 Subject: Extend `as` and `is` operator to work on generic types. (#3672) --- source/slang/slang-ir.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index ff9c6f6f8..fd5ea0fc7 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -31,6 +31,11 @@ namespace Slang { if (!irObject) return; + if (as(irObject)) + { + getTypeNameHint(sb, irObject); + return; + } if (auto nameHint = irObject->findDecoration()) { sb << nameHint->getName(); -- cgit v1.2.3