[be] Remove unnecessary check for SetState type in analyzefunctions

This was used as part of the previous ValidateNoSetStateInRender, but i rewrote 
that to not rely on the mutable range of function expressions.
This commit is contained in:
Joe Savona
2023-12-15 13:47:21 -08:00
parent 2abd439b43
commit ec27708024
@@ -10,12 +10,11 @@ import {
Effect,
HIRFunction,
Identifier,
isRefValueType,
isSetStateType,
isUseRefType,
LoweredFunction,
Place,
ReactiveScopeDependency,
isRefValueType,
isUseRefType,
} from "../HIR";
import { deadCodeElimination } from "../Optimization";
import { inferReactiveScopeVariables } from "../ReactiveScopes";
@@ -139,11 +138,7 @@ function infer(
name = dep.identifier.name;
}
if (
isUseRefType(dep.identifier) ||
isRefValueType(dep.identifier) ||
isSetStateType(dep.identifier)
) {
if (isUseRefType(dep.identifier) || isRefValueType(dep.identifier)) {
/*
* TODO: this is a hack to ensure we treat functions which reference refs
* as having a capture and therefore being considered mutable. this ensures