From a5efbb1b775afb2f6b29b37d39947c41744bb005 Mon Sep 17 00:00:00 2001 From: Ronan Date: Sat, 26 Apr 2025 21:04:01 +0200 Subject: Added getCanonicalGenericConstraints2 (sorts constraints and allows more generic expressions) (#6787) --- source/slang/slang-check-expr.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/slang/slang-check-expr.cpp') diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp index 7b774f300..2c595dd4a 100644 --- a/source/slang/slang-check-expr.cpp +++ b/source/slang/slang-check-expr.cpp @@ -663,8 +663,7 @@ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult( auto structDecl = m_astBuilder->create(); auto conformanceDecl = m_astBuilder->create(); conformanceDecl->base.type = m_astBuilder->getDiffInterfaceType(); - conformanceDecl->parentDecl = structDecl; - structDecl->members.add(conformanceDecl); + structDecl->addMember(conformanceDecl); structDecl->parentDecl = parent; synthesizedDecl = structDecl; @@ -678,10 +677,9 @@ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult( typeDef->type.type = DeclRefType::create(m_astBuilder, synthDeclRef); structDecl->members.add(typeDef); - synthesizedDecl->parentDecl = parent; synthesizedDecl->nameAndLoc.name = item.declRef.getName(); synthesizedDecl->loc = parent->loc; - parent->members.add(synthesizedDecl); + parent->addMember(synthesizedDecl); parent->invalidateMemberDictionary(); // Mark the newly synthesized decl as `ToBeSynthesized` so future checking can @@ -697,7 +695,6 @@ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult( // auto typeDef = m_astBuilder->create(); typeDef->nameAndLoc.name = item.declRef.getName(); - typeDef->parentDecl = parent; // Compute the decl's type as if it is referred to from itself. This is important // because subType may have substitutions from the context it is used in, while this @@ -708,7 +705,7 @@ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult( synthesizedDecl = parent; - parent->members.add(typeDef); + parent->addMember(typeDef); parent->invalidateMemberDictionary(); markSelfDifferentialMembersOfType(parent, subType); -- cgit v1.2.3