We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ForceValueExpr
1 parent e301b19 commit b7bdda4Copy full SHA for b7bdda4
lib/Sema/CSBindings.cpp
@@ -1013,7 +1013,8 @@ bool ConstraintSystem::PotentialBindings::infer(
1013
// type from context e.g. parameter type of a function call),
1014
// we need to test type with and without l-value after
1015
// delaying bindings for as long as possible.
1016
- if (isExpr<ForceValueExpr>(anchor) && !type->is<LValueType>()) {
+ if (isExpr<ForceValueExpr>(anchor) &&
1017
+ TypeVar->getImpl().canBindToLValue() && !type->is<LValueType>()) {
1018
addPotentialBinding(binding->withType(LValueType::get(type)));
1019
DelayedBy.push_back(constraint);
1020
}
0 commit comments