[Sema] fix lvalue-ness constrain

This commit is contained in:
omochimetaru
2019-08-11 21:59:58 +09:00
parent ca4c2211b9
commit 5b773fc46d

View File

@@ -2059,12 +2059,12 @@ ConstraintSystem::matchTypesBindTypeVar(
type.visit([&](Type t) {
if (auto *tvt = dyn_cast<TypeVariableType>(t.getPointer())) {
if (!typeVar->getImpl().canBindToLValue()) {
typeVar->getImpl().setCanBindToLValue(getSavedBindings(),
/*enabled=*/false);
tvt->getImpl().setCanBindToLValue(getSavedBindings(),
/*enabled=*/false);
}
if (!typeVar->getImpl().canBindToNoEscape()) {
typeVar->getImpl().setCanBindToNoEscape(getSavedBindings(),
/*enabled=*/false);
tvt->getImpl().setCanBindToNoEscape(getSavedBindings(),
/*enabled=*/false);
}
}
});