diff --git a/src/ast/scopes/BlockScope.ts b/src/ast/scopes/BlockScope.ts index b50141b778b..494d7979924 100644 --- a/src/ast/scopes/BlockScope.ts +++ b/src/ast/scopes/BlockScope.ts @@ -11,16 +11,11 @@ export default class BlockScope extends ChildScope { context: AstContext, init: ExpressionEntity | null = null, isHoisted = false - ) { + ): LocalVariable { if (isHoisted) { - return this.parent.addDeclaration( - identifier, - context, - UNKNOWN_EXPRESSION, - true - ) as LocalVariable; + return this.parent.addDeclaration(identifier, context, UNKNOWN_EXPRESSION, true); } else { - return super.addDeclaration(identifier, context, init, false) as LocalVariable; + return super.addDeclaration(identifier, context, init, false); } } } diff --git a/src/ast/scopes/CatchScope.ts b/src/ast/scopes/CatchScope.ts index bafa90a1e06..109d3da8f25 100644 --- a/src/ast/scopes/CatchScope.ts +++ b/src/ast/scopes/CatchScope.ts @@ -10,11 +10,11 @@ export default class CatchScope extends ParameterScope { context: AstContext, init: ExpressionEntity | null = null, isHoisted = false - ) { + ): LocalVariable { if (isHoisted) { - return this.parent.addDeclaration(identifier, context, init, true) as LocalVariable; + return this.parent.addDeclaration(identifier, context, init, true); } else { - return super.addDeclaration(identifier, context, init, false) as LocalVariable; + return super.addDeclaration(identifier, context, init, false); } } }