@@ -1716,24 +1716,10 @@ namespace {
1716
1716
// For properties, build member references.
1717
1717
if (auto *varDecl = dyn_cast<VarDecl>(member)) {
1718
1718
// \returns result of the given function type
1719
- bool loadImmediately = false ;
1720
- auto resultType = [&loadImmediately](Type fnTy) -> Type {
1721
- Type resultTy = fnTy->castTo <FunctionType>()->getResult ();
1722
- if (loadImmediately)
1723
- return LValueType::get (resultTy);
1724
- return resultTy;
1719
+ auto resultType = [](Type fnTy) -> Type {
1720
+ return fnTy->castTo <FunctionType>()->getResult ();
1725
1721
};
1726
1722
1727
- // If we have an instance property that's treated as an rvalue
1728
- // but allows assignment (for initialization) in the current
1729
- // context, treat it as an rvalue that we immediately load.
1730
- // This is the AST that's expected by SILGen.
1731
- if (baseIsInstance && !resultType (refTy)->hasLValueType () &&
1732
- varDecl->mutability (dc, dyn_cast<DeclRefExpr>(base))
1733
- == StorageMutability::Initializable) {
1734
- loadImmediately = true ;
1735
- }
1736
-
1737
1723
if (isUnboundInstanceMember) {
1738
1724
assert (memberLocator.getBaseLocator () &&
1739
1725
cs.UnevaluatedRootExprs .count (
@@ -1779,12 +1765,6 @@ namespace {
1779
1765
result, conversionTy));
1780
1766
}
1781
1767
}
1782
-
1783
- // If we need to load, do so now.
1784
- if (loadImmediately) {
1785
- result = cs.addImplicitLoadExpr (result);
1786
- }
1787
-
1788
1768
return forceUnwrapIfExpected (result, memberLocator);
1789
1769
}
1790
1770
0 commit comments