diff --git a/src/ast/nodes/shared/FunctionBase.ts b/src/ast/nodes/shared/FunctionBase.ts index 76b48c7bb4f..e6fc3fb83b7 100644 --- a/src/ast/nodes/shared/FunctionBase.ts +++ b/src/ast/nodes/shared/FunctionBase.ts @@ -79,8 +79,8 @@ export default abstract class FunctionBase extends NodeBase { private deoptimizeParameterVariableValues() { for (const parameter of this.params) { if (parameter instanceof Identifier) { - const parameterVariable = parameter.variable as ParameterVariable | null; - parameterVariable?.markReassigned(); + const parameterVariable = parameter.variable as ParameterVariable; + parameterVariable.markReassigned(); } } } diff --git a/src/ast/variables/ParameterVariable.ts b/src/ast/variables/ParameterVariable.ts index 2115048dc9a..a17bf3b1152 100644 --- a/src/ast/variables/ParameterVariable.ts +++ b/src/ast/variables/ParameterVariable.ts @@ -143,7 +143,7 @@ export default class ParameterVariable extends LocalVariable { * The optimization can be undone by calling `markReassigned`. * @returns the frozen value */ - getKnownValue(): ExpressionEntity { + private getKnownValue(): ExpressionEntity { if (this.frozenValue === null) { this.frozenValue = this.knownValue || UNKNOWN_EXPRESSION; }