summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-conversion.cpp
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2025-08-01 12:36:29 -0700
committerGitHub <noreply@github.com>2025-08-01 19:36:29 +0000
commit8a15efb37a33d3c2943be87a19cbf9b5e2e8432b (patch)
tree3ee02acbcfc4b53112427ce9febc2aa0d92815ed /source/slang/slang-check-conversion.cpp
parent6239a67cbeb3c551e08bfbf96044a0451e8ecc24 (diff)
Drain sink when single-argument constructor call fail (#7883)
* fix bug * fix test * push test changs for clarity * fix bug * fix test * push test changs for clarity * test what fails * remove redundant code
Diffstat (limited to 'source/slang/slang-check-conversion.cpp')
-rw-r--r--source/slang/slang-check-conversion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-check-conversion.cpp b/source/slang/slang-check-conversion.cpp
index 61d132627..a605928e3 100644
--- a/source/slang/slang-check-conversion.cpp
+++ b/source/slang/slang-check-conversion.cpp
@@ -1711,6 +1711,8 @@ bool SemanticsVisitor::_coerce(
}
}
+ bool result = true;
+
// Conceptually, we want to treat the conversion as
// possible, but report it as ambiguous if we actually
// need to reify the result as an expression.
@@ -1723,6 +1725,7 @@ bool SemanticsVisitor::_coerce(
}
*outToExpr = CreateErrorExpr(fromExpr);
+ result = false;
}
if (!cachedMethod)
@@ -1734,7 +1737,7 @@ bool SemanticsVisitor::_coerce(
if (outCost)
*outCost = bestCost;
- return true;
+ return result;
}
else if (overloadContext.bestCandidate)
{