summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-07-16 16:16:02 -0400
committerGitHub <noreply@github.com>2024-07-16 16:16:02 -0400
commitb5174b473ffb41e92b4efc844f60d7239f3322a3 (patch)
treebe80bdf9563abfa0957a04e7b0b08fe2fbdd581c
parent12ecc43ae07035d951beb531058ba27bdfb9c0de (diff)
Fix issue with synthesized `__init` methods not getting added to witness table (#4638)
-rw-r--r--source/slang/slang-check-decl.cpp4
-rw-r--r--tests/compute/assoctype-nested-lookup.slang2
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<float> outputBuffer;
-interface IFoo
+interface IFoo : IDefaultInitializable
{
associatedtype Bar : IFoo;
};