Skip to content

Commit

Permalink
Update on "[compiler] Repro for missing memoization due to inferred m…
Browse files Browse the repository at this point in the history
…utation"

This fixture bails out on ValidatePreserveExistingMemo but would ideally memoize since the original memoization is safe. It's trivial to make it pass by commenting out the commented line (`LogEvent.log(() => object)`). I would expect the compiler to infer this as possible mutation of `logData`, since `object` captures a reference to `logData`. But somehow `logData` is getting memoized successfully, but we still infer the callback, `setCurrentIndex`, as having a mutable range that extends to the `setCurrentIndex()` call after the useCallback.

[ghstack-poisoned]
  • Loading branch information
josephsavona committed Aug 21, 2024
1 parent c9bb95e commit 88e2c22
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {CompilerError, Effect, ErrorSeverity, printReactiveFunction} from '..';
import {CompilerError, Effect, ErrorSeverity} from '..';
import {
DeclarationId,
GeneratedSource,
Expand All @@ -23,11 +23,7 @@ import {
ScopeId,
SourceLocation,
} from '../HIR';
import {
printFunction,
printIdentifier,
printManualMemoDependency,
} from '../HIR/PrintHIR';
import {printIdentifier, printManualMemoDependency} from '../HIR/PrintHIR';
import {eachInstructionValueOperand} from '../HIR/visitors';
import {collectMaybeMemoDependencies} from '../Inference/DropManualMemoization';
import {
Expand Down

0 comments on commit 88e2c22

Please sign in to comment.