From c763750a7305fbf12c1f5c177260294a32fe286d Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Thu, 2 May 2024 19:01:21 -0400 Subject: Handle case where types can be used as their own `Differential` type. (#4057) * Avoid synthesis for when types can be used as their own differenial + Add test * Add missing files.. * Fix issue with method synthesis for self-differential types + Add a generic test * Fix * Fix issue with out-of-date type resolution cache. Witness tables created during the conformance checking phase not being taken into account during the decl type resolution phase because the epoch is not updated after conformance checking. This leads to certain complex associated-type lookup chains (such as the one in tests/compute/assoctype-nested-lookup) not resolving properly and causing errors. * Delete self-differential-type-synthesis-extension.slang * Quick fix to repopulate stdlib cache for deferred stdlib loading * Update slang-check-decl.cpp --- source/slang/slang-options.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 857f4272c..805ea0fff 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -1707,6 +1707,10 @@ SlangResult OptionsParser::_parse( ScopedAllocation contents; SLANG_RETURN_ON_FAIL(File::readAllBytes(fileName.value, contents)); SLANG_RETURN_ON_FAIL(m_session->loadStdLib(contents.getData(), contents.getSizeInBytes())); + + // Ensure that the linkage's AST builder is up-to-date. + linkage->getASTBuilder()->m_cachedNodes = asInternal(m_session)->getGlobalASTBuilder()->m_cachedNodes; + break; } case OptionKind::CompileStdLib: m_compileStdLib = true; break; -- cgit v1.2.3