From a5cdb574b391e8adce1ce71e1e7ab3a20ce15818 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 31 May 2024 22:08:27 -0700 Subject: Fix a bug on default initialization of interface typed value. (#4249) * Fix a bug on default initialization of interface typed value. * Fix. --- source/slang/slang-lower-to-ir.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 8a8d235f5..80e73fe2b 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -4413,6 +4413,10 @@ struct ExprLoweringVisitorBase : public ExprVisitor { return LoweredValInfo::simple(getBuilder()->getIntValue(irType, 0)); } + else if (declRef.as()) + { + return LoweredValInfo::simple(getBuilder()->emitDefaultConstruct(irType)); + } else if (auto aggTypeDeclRef = declRef.as()) { List args; -- cgit v1.2.3