dillon1000/react

Commit

[inference] Capturing an immutable value should be a read

--- 

Following #1216: 

If a value is known to be immutable, then it doesn't need to be considered 
'captured' since no mutation should occur. 

Couldn't figure out a unit test in which this specific fix matters, but we need 
this to fix test output of #1273 

cc. @gsathya, would love some feedback / eyes on this. This makes sense for 
Primitives in particular (which are always read / copied in rval position), but 
I'm not as familiar with edge cases for other immutable values especially around 
lambdas.
Browse files
Changed paths2 files
First-parent comparison
M compiler/forget/src/Inference/InferReferenceEffects.ts ModifiedM compiler/forget/src/__tests__/fixtures/hir/destructure-capture-global.expect.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…