swift
4964a662 - silgen: inherit eval scope for OpenExistentialExpr

Commit
11 days ago
silgen: inherit eval scope for OpenExistentialExpr We were not able to use an existential as the base of an access that strictly borrows the existential, because SILGen's RValue emission would establish a fresh evaluation scope just for the existential's opening, and then copy the opened value out. This is problematic for noncopyable existentials. So this patch moves & adds FormalEvaluationScope's around so they're broad enough to enable a borrow of an existential. The idea behind this refactoring is to establish top-level FormalEvaluationScopes when initially creating RValue's for Expr's in SILGen. Any more-tightly scoped operations will already establish their own nested scope, so this is mostly adding safe-guards. I've limited the existentials fix to noncopyables for now. part of rdar://159079818
Author
Committer
Parents
Loading