From ab04bd0dd7dd6a818bbac8c5fef9372c4f597352 Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:11:45 -0400 Subject: More `slangpy` features + polishing (#3233) * Update user-guide with new slangpy features * More polishing of new slangpy docs * Update a1-02-slangpy.md * Only require contiguity for vector element types * Added `loadOnce/storeOnce` and subscript operations * Added docs, `DiffTensorView.dims()` & `DiffTensorView.stride(uint)` * Add constructors, remove storeOnce/loadOnce test * Adjusted intrinsic definitions --- source/slang/slang-check-overload.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-check-overload.cpp') 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 -- cgit v1.2.3