summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2023-10-05 12:52:49 -0400
committerGitHub <noreply@github.com>2023-10-05 09:52:49 -0700
commit441e13e13f30b96eb04c05725ad7fe1983c92f53 (patch)
treeaee5c31b62876ef8ad60a37b2a4767b6f1a299c6 /source/slang/slang-check-expr.cpp
parent65751ce222adb302e62b5b7b6312de65638abed5 (diff)
Various AD Fixes (#3263)
* Various fixes * Remove unused parameter * Update slang-ir-loop-unroll.cpp --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index abdd89b01..05a6ed249 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -422,7 +422,9 @@ namespace Slang
return result;
}
- Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult(LookupResultItem const& item, Expr* originalExpr)
+ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult(
+ LookupResultItem const& item,
+ Expr* originalExpr)
{
// If the only result from lookup is an entry in an interface decl, it could be that
// the user is leaving out an explicit definition for the requirement and depending on
@@ -521,13 +523,16 @@ namespace Slang
conformanceDecl->base.type = m_astBuilder->getDiffInterfaceType();
conformanceDecl->parentDecl = structDecl;
structDecl->members.add(conformanceDecl);
+ structDecl->parentDecl = parent;
synthesizedDecl = structDecl;
auto typeDef = m_astBuilder->create<TypeAliasDecl>();
typeDef->nameAndLoc.name = getName("Differential");
- auto declRef = createDefaultSubstitutionsIfNeeded(m_astBuilder, this, makeDeclRef(structDecl));
- typeDef->type.type = DeclRefType::create(m_astBuilder, declRef);
typeDef->parentDecl = structDecl;
+
+ auto synthDeclRef = createDefaultSubstitutionsIfNeeded(m_astBuilder, this, makeDeclRef(structDecl));
+
+ typeDef->type.type = DeclRefType::create(m_astBuilder, synthDeclRef);
structDecl->members.add(typeDef);
}
break;
@@ -545,8 +550,9 @@ namespace Slang
auto toBeSynthesized = m_astBuilder->create<ToBeSynthesizedModifier>();
addModifier(synthesizedDecl, toBeSynthesized);
+ auto synthDeclMemberRef = m_astBuilder->getMemberDeclRef(subType->getDeclRef(), synthesizedDecl);
return ConstructDeclRefExpr(
- makeDeclRef(synthesizedDecl),
+ synthDeclMemberRef,
nullptr,
originalExpr ? originalExpr->loc : SourceLoc(),
originalExpr);