From 917079cd118203f6278655134158473e2a65615b Mon Sep 17 00:00:00 2001 From: Sergii Kuzko Date: Wed, 22 Apr 2026 13:36:35 +0300 Subject: [PATCH] sync_22267_from_dmd_repo --- compiler/src/dmd/semantic3.d | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/compiler/src/dmd/semantic3.d b/compiler/src/dmd/semantic3.d index f6af945fa2..801251cf49 100644 --- a/compiler/src/dmd/semantic3.d +++ b/compiler/src/dmd/semantic3.d @@ -1707,25 +1707,19 @@ private struct FuncDeclSem3 extern (C++) void semanticTypeInfoMembers(StructDeclaration sd) { - if (sd.xeq && - sd.xeq._scope && - sd.xeq.semanticRun < PASS.semantic3done) + void runSemantic(ref FuncDeclaration fd, ref FuncDeclaration errFd) { - uint errors = global.startGagging(); - sd.xeq.semantic3(sd.xeq._scope); - if (global.endGagging(errors)) - sd.xeq = sd.xerreq; + if (fd && fd._scope && fd.semanticRun < PASS.semantic3done) + { + const errors = global.startGagging(); + fd.semantic3(fd._scope); + if (global.endGagging(errors)) + fd = errFd; + } } - if (sd.xcmp && - sd.xcmp._scope && - sd.xcmp.semanticRun < PASS.semantic3done) - { - uint errors = global.startGagging(); - sd.xcmp.semantic3(sd.xcmp._scope); - if (global.endGagging(errors)) - sd.xcmp = sd.xerrcmp; - } + runSemantic(sd.xeq, sd.xerreq); + runSemantic(sd.xcmp, sd.xerrcmp); FuncDeclaration ftostr = search_toString(sd); if (ftostr &&