From b5174b473ffb41e92b4efc844f60d7239f3322a3 Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:16:02 -0400 Subject: Fix issue with synthesized `__init` methods not getting added to witness table (#4638) --- source/slang/slang-check-decl.cpp | 4 ++-- tests/compute/assoctype-nested-lookup.slang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index d3c3e23ab..28d1ae02e 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -4268,8 +4268,8 @@ namespace Slang } if (isDefaultInitializableType) context->parentDecl->addMember(ctorDecl); - else - _addMethodWitness(witnessTable, requiredMemberDeclRef, makeDeclRef(ctorDecl)); + + _addMethodWitness(witnessTable, requiredMemberDeclRef, makeDeclRef(ctorDecl)); return true; } diff --git a/tests/compute/assoctype-nested-lookup.slang b/tests/compute/assoctype-nested-lookup.slang index 518e88e25..b1ca75d49 100644 --- a/tests/compute/assoctype-nested-lookup.slang +++ b/tests/compute/assoctype-nested-lookup.slang @@ -6,7 +6,7 @@ //TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer RWStructuredBuffer outputBuffer; -interface IFoo +interface IFoo : IDefaultInitializable { associatedtype Bar : IFoo; }; -- cgit v1.2.3