diff options
| author | Yong He <yonghe@outlook.com> | 2022-12-01 22:30:24 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-01 22:30:24 -0800 |
| commit | 1562e73dfa3e4c1283811e478af25c6447a528c0 (patch) | |
| tree | 7f85249752db6bc0b37db396f3f4025856ad1937 | |
| parent | f7d32a33702f9326c536fb07ea5b6c6121aeb6b3 (diff) | |
Cleanup creation of `IDifferentiableType` in semantics checking. (#2548)
Co-authored-by: Yong He <yhe@nvidia.com>
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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<InheritanceDecl>(); - 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<InterfaceDecl>(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<NoDiffThisAttribute>() != nullptr); if (noDiffThisRequirement != noDiffThisSatisfying) return false; |
