summaryrefslogtreecommitdiff
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index cc2cf46a1..d479ba32a 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -1548,7 +1548,18 @@ void Type::accept(IValVisitor* visitor, void* extra)
if (auto thisTypeSubst = as<ThisTypeSubstitution>(subst))
{
- return witness->EqualsVal(thisTypeSubst->witness);
+ // For our purposes, two this-type substitutions are
+ // equivalent if they have the same type as `This`,
+ // even if the specific witness values they use
+ // might differ.
+ //
+ if(this->interfaceDecl != thisTypeSubst->interfaceDecl)
+ return false;
+
+ if(!this->witness->sub->Equals(thisTypeSubst->witness->sub))
+ return false;
+
+ return true;
}
return false;
}