summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-overload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-overload.cpp')
-rw-r--r--source/slang/slang-check-overload.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/slang/slang-check-overload.cpp b/source/slang/slang-check-overload.cpp
index d7ed5975d..c668155df 100644
--- a/source/slang/slang-check-overload.cpp
+++ b/source/slang/slang-check-overload.cpp
@@ -964,10 +964,14 @@ namespace Slang
{
auto leftType = DeclRefType::create(m_astBuilder, left.declRef.getParent());
auto rightType = DeclRefType::create(m_astBuilder, right.declRef.getParent());
- if (isSubtype(leftType, rightType))
- return -1;
- if (isSubtype(rightType, leftType))
- return 1;
+
+ if (!leftType->equals(rightType))
+ {
+ if (isSubtype(leftType, rightType))
+ return -1;
+ if (isSubtype(rightType, leftType))
+ return 1;
+ }
}
// TODO: We should generalize above rules such that in a tie a declaration