From 1562e73dfa3e4c1283811e478af25c6447a528c0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 1 Dec 2022 22:30:24 -0800 Subject: Cleanup creation of `IDifferentiableType` in semantics checking. (#2548) Co-authored-by: Yong He --- source/slang/slang-check-decl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index d8968e33a..80bf74e53 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -1501,8 +1501,7 @@ namespace Slang // Make the Differential type itself conform to `IDifferential` interface. auto inheritanceIDiffernetiable = m_astBuilder->create(); - inheritanceIDiffernetiable->base.type = - DeclRefType::create(m_astBuilder, m_astBuilder->getDifferentiableInterface()); + inheritanceIDiffernetiable->base.type = m_astBuilder->getDiffInterfaceType(); inheritanceIDiffernetiable->parentDecl = aggTypeDecl; aggTypeDecl->members.add(inheritanceIDiffernetiable); @@ -1935,8 +1934,7 @@ namespace Slang auto parentInterfaceDecl = as(getParentDecl(requiredMemberDeclRef.getDecl())); if (parentInterfaceDecl) { - auto idiffType = DeclRefType::create(m_astBuilder, m_astBuilder->getDifferentiableInterface()); - bool noDiffThisSatisfying = !isDeclaredSubtype(witnessTable->witnessedType, idiffType); + bool noDiffThisSatisfying = !isTypeDifferentiable(witnessTable->witnessedType); bool noDiffThisRequirement = (requiredMemberDeclRef.getDecl()->findModifier() != nullptr); if (noDiffThisRequirement != noDiffThisSatisfying) return false; -- cgit v1.2.3