diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 3328315b274f8e7718d6ed1563ff158f1ef666da..7c28521f96563d4ced64d7e7dcf6314625e6ca52 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -136,8 +136,7 @@ import { STDLIB_TASKPOOL_OBJECT_NAME } from './utils/consts/TaskpoolAPI'; import { BaseTypeScriptLinter } from './BaseTypeScriptLinter'; -import type { ArrayAccess, UncheckedIdentifier, CheckedIdentifier } from './utils/consts/RuntimeCheckAPI'; -import { CheckResult } from './utils/consts/RuntimeCheckAPI'; +import type { ArrayAccess, UncheckedIdentifier } from './utils/consts/RuntimeCheckAPI'; import { NUMBER_LITERAL } from './utils/consts/RuntimeCheckAPI'; import { globalApiAssociatedInfo } from './utils/consts/AssociatedInfo'; @@ -332,7 +331,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { [ts.SyntaxKind.ForStatement, this.handleForStatement], [ts.SyntaxKind.ForInStatement, this.handleForInStatement], [ts.SyntaxKind.ForOfStatement, this.handleForOfStatement], - [ts.SyntaxKind.IfStatement, this.handleIfStatement], [ts.SyntaxKind.ImportDeclaration, this.handleImportDeclaration], [ts.SyntaxKind.PropertyAccessExpression, this.handlePropertyAccessExpression], [ts.SyntaxKind.PropertyDeclaration, this.handlePropertyDeclaration], @@ -922,78 +920,10 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { const tsForStmt = node as ts.ForStatement; const tsForInit = tsForStmt.initializer; if (tsForInit) { - this.checkStaticArrayControl(tsForStmt); this.checkForLoopDestructuring(tsForInit); } } - private checkStaticArrayControl(tsForStmt: ts.ForStatement): void { - if (!this.options.arkts2 || !this.useStatic) { - return; - } - - if (!ts.isBlock(tsForStmt.statement)) { - return; - } - - const loopBody = tsForStmt.statement; - const arrayAccessInfo = this.checkBodyHasArrayAccess(loopBody); - const loopCondition = tsForStmt.condition; - - if (!arrayAccessInfo) { - return; - } - if (!loopCondition) { - this.incrementCounters(arrayAccessInfo.arrayIdent.parent, FaultID.RuntimeArrayCheck); - return; - } - const arraySymbol = this.tsUtils.trueSymbolAtLocation(arrayAccessInfo.arrayIdent); - if (!arraySymbol) { - return; - } - - const arrayCheckedAgainst = this.checkConditionForArrayAccess(loopCondition, arraySymbol); - if (!arrayCheckedAgainst) { - this.incrementCounters(arrayAccessInfo.arrayIdent.parent, FaultID.RuntimeArrayCheck); - return; - } - - this.checkIfAccessAndCheckVariablesMatch(arrayAccessInfo, arrayCheckedAgainst); - } - - private checkIfAccessAndCheckVariablesMatch(accessInfo: ArrayAccess, checkedAgainst: CheckedIdentifier): void { - const { arrayIdent, accessingIdentifier } = accessInfo; - - if (accessingIdentifier === NUMBER_LITERAL) { - if (checkedAgainst === NUMBER_LITERAL) { - return; - } - this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); - return; - } - - if (checkedAgainst === NUMBER_LITERAL) { - this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); - return; - } - - const checkedAgainstSym = this.tsUtils.trueSymbolAtLocation(checkedAgainst); - if (!checkedAgainstSym) { - return; - } - - const accessingIdentSym = this.tsUtils.trueSymbolAtLocation(accessingIdentifier); - - if (checkedAgainstSym !== accessingIdentSym) { - this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); - return; - } - - if (this.isChangedAfterCheck(arrayIdent.getSourceFile(), checkedAgainstSym)) { - this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); - } - } - private checkConditionForArrayAccess(condition: ts.Expression, arraySymbol: ts.Symbol): UncheckedIdentifier { if (!ts.isBinaryExpression(condition)) { return undefined; @@ -1057,115 +987,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return arrayAccessResult; } - private checkArrayUsageWithoutBound(accessExpr: ts.ElementAccessExpression): void { - if (!this.options.arkts2 || !this.useStatic) { - return; - } - - const arrayAccessInfo = this.isElementAccessOfArray(accessExpr); - if (!arrayAccessInfo) { - return; - } - - const { arrayIdent } = arrayAccessInfo; - const arraySym = this.tsUtils.trueSymbolAtLocation(arrayIdent); - if (!arraySym) { - return; - } - const sourceFile = arrayIdent.getSourceFile(); - let boundChecked = true; - - for (const statement of sourceFile.statements) { - const checkResult = this.checkStatementForArrayAccess(statement, arrayAccessInfo, arraySym); - if (checkResult === CheckResult.SKIP) { - boundChecked = false; - continue; - } - - if (checkResult === CheckResult.HAS_ARRAY_ACCES) { - continue; - } - - if (checkResult === CheckResult.CHECKED) { - boundChecked = true; - break; - } - } - - if (!boundChecked) { - this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); - } - } - - private checkStatementForArrayAccess( - statement: ts.Statement, - accessInfo: ArrayAccess, - arraySym: ts.Symbol - ): CheckResult { - if (ts.isForStatement(statement)) { - return this.isThisArrayAccess(statement.statement as ts.Block, accessInfo.arrayIdent); - } - - if (!ts.isIfStatement(statement)) { - return CheckResult.SKIP; - } - - const thisArrayAccess = this.isThisArrayAccess(statement.thenStatement as ts.Block, accessInfo.arrayIdent); - if (thisArrayAccess !== CheckResult.SKIP) { - return thisArrayAccess; - } - - const checkedAgainst = this.checkConditionForArrayAccess(statement.expression, arraySym); - if (!checkedAgainst) { - return CheckResult.SKIP; - } - - this.checkIfAccessAndCheckVariablesMatch(accessInfo, checkedAgainst); - return CheckResult.CHECKED; - } - - private isThisArrayAccess(block: ts.Block, arrayIdent: ts.Identifier): CheckResult { - const info = this.checkBodyHasArrayAccess(block); - if (!info) { - return CheckResult.SKIP; - } - - if (info.arrayIdent === arrayIdent) { - return CheckResult.CHECKED; - } - - return CheckResult.HAS_ARRAY_ACCES; - } - - private isChangedAfterCheck(sourceFile: ts.SourceFile, sym: ts.Symbol): boolean { - for (const statement of sourceFile.statements) { - if (!ts.isExpressionStatement(statement)) { - continue; - } - if (!ts.isBinaryExpression(statement.expression)) { - continue; - } - if (!ts.isIdentifier(statement.expression.left)) { - continue; - } - if (statement.expression.operatorToken.kind !== ts.SyntaxKind.EqualsToken) { - continue; - } - - const leftSym = this.tsUtils.trueSymbolAtLocation(statement.expression.left); - if (!leftSym) { - continue; - } - - if (leftSym === sym) { - return true; - } - continue; - } - - return false; - } - private handleForInStatement(node: ts.Node): void { const tsForInStmt = node as ts.ForInStatement; const tsForInInit = tsForInStmt.initializer; @@ -1180,37 +1001,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleForOfJsArray(tsForOfStmt); } - private handleIfStatement(ifStatement: ts.IfStatement): void { - if (this.options.arkts2 && this.useStatic) { - this.checkIfStatementForArrayUsage(ifStatement); - } - } - - private checkIfStatementForArrayUsage(ifStatement: ts.IfStatement): void { - if (!ts.isBlock(ifStatement.thenStatement)) { - return; - } - - const accessInfo = this.checkBodyHasArrayAccess(ifStatement.thenStatement); - if (!accessInfo) { - return; - } - const { arrayIdent } = accessInfo; - - const arraySymbol = this.tsUtils.trueSymbolAtLocation(arrayIdent); - if (!arraySymbol) { - return; - } - - const checkedAgainst = this.checkConditionForArrayAccess(ifStatement.expression, arraySymbol); - if (!checkedAgainst) { - this.incrementCounters(arrayIdent, FaultID.RuntimeArrayCheck); - return; - } - - this.checkIfAccessAndCheckVariablesMatch(accessInfo, checkedAgainst); - } - private updateDataSdkJsonInfo(importDeclNode: ts.ImportDeclaration, importClause: ts.ImportClause): void { const sdkInfo = TypeScriptLinter.pathMap.get(importDeclNode.moduleSpecifier.getText()); if (sdkInfo && importClause.namedBindings) { @@ -9624,4 +9414,396 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.incrementCounters(node, FaultID.NumericSemantics, autofix); } } + + private checkArrayUsageWithoutBound(accessExpr: ts.ElementAccessExpression): void { + if (!this.options.arkts2 || !this.useStatic) { + return; + } + + const arrayAccessInfo = this.getArrayAccessInfo(accessExpr); + if (!arrayAccessInfo) { + const accessArgument = accessExpr.argumentExpression; + if (TypeScriptLinter.isFunctionCall(accessArgument)) { + this.incrementCounters(accessExpr, FaultID.RuntimeArrayCheck); + } + return; + } + + const { arrayIdent } = arrayAccessInfo; + const arraySym = this.tsUtils.trueSymbolAtLocation(arrayIdent); + if (!arraySym) { + return; + } + + const indexExpr = accessExpr.argumentExpression; + const loopVarName = ts.isIdentifier(indexExpr) ? indexExpr.text : undefined; + + const { isInSafeContext, isValidBoundCheck, isVarModifiedBeforeAccess } = this.analyzeSafeContext( + accessExpr, + loopVarName, + arraySym + ); + + if (isInSafeContext) { + if (!isValidBoundCheck || isVarModifiedBeforeAccess) { + this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); + } + } else { + this.incrementCounters(arrayIdent.parent, FaultID.RuntimeArrayCheck); + } + } + + private analyzeSafeContext( + accessExpr: ts.ElementAccessExpression, + loopVarName: string | undefined, + arraySym: ts.Symbol + ): { isInSafeContext: boolean; isValidBoundCheck: boolean; isVarModifiedBeforeAccess: boolean } { + const context = TypeScriptLinter.findSafeContext(accessExpr); + if (!context) { + return { isInSafeContext: false, isValidBoundCheck: false, isVarModifiedBeforeAccess: false }; + } + + return this.analyzeContextSafety(context, accessExpr, loopVarName, arraySym); + } + + static findSafeContext( + accessExpr: ts.ElementAccessExpression + ): { node: ts.ForStatement | ts.WhileStatement | ts.IfStatement } | void { + let currentNode: ts.Node | undefined = accessExpr; + + while (currentNode) { + if (ts.isForStatement(currentNode) || ts.isWhileStatement(currentNode) || ts.isIfStatement(currentNode)) { + return { node: currentNode }; + } + currentNode = currentNode.parent; + } + + return undefined; + } + + private analyzeContextSafety( + context: { node: ts.ForStatement | ts.WhileStatement | ts.IfStatement }, + accessExpr: ts.ElementAccessExpression, + loopVarName: string | undefined, + arraySym: ts.Symbol + ): { isInSafeContext: boolean; isValidBoundCheck: boolean; isVarModifiedBeforeAccess: boolean } { + const { node } = context; + + if (!loopVarName) { + return { + isInSafeContext: true, + isValidBoundCheck: false, + isVarModifiedBeforeAccess: false + }; + } + + const analysis = this.analyzeStatementType( node, accessExpr, loopVarName, arraySym); + + return { + isInSafeContext: true, + isValidBoundCheck: analysis.isValidBoundCheck, + isVarModifiedBeforeAccess: analysis.isVarModifiedBeforeAccess + }; + } + + private analyzeStatementType( + node: ts.ForStatement | ts.WhileStatement | ts.IfStatement, + accessExpr: ts.ElementAccessExpression, + loopVarName: string, + arraySym: ts.Symbol + ): { isValidBoundCheck: boolean; isVarModifiedBeforeAccess: boolean } { + switch (node.kind) { + case ts.SyntaxKind.ForStatement: + return this.analyzeForStatement(node as ts.ForStatement, accessExpr, loopVarName, arraySym); + case ts.SyntaxKind.WhileStatement: + return this.analyzeWhileStatement(node as ts.WhileStatement, accessExpr, loopVarName, arraySym); + case ts.SyntaxKind.IfStatement: + return this.analyzeIfStatement(node as ts.IfStatement, accessExpr, loopVarName, arraySym); + default: + return { isValidBoundCheck: false, isVarModifiedBeforeAccess: false }; + } + } + + private analyzeForStatement( + forNode: ts.ForStatement, + accessExpr: ts.ElementAccessExpression, + loopVarName: string, + arraySym: ts.Symbol + ): { isValidBoundCheck: boolean; isVarModifiedBeforeAccess: boolean } { + const isValidBoundCheck = forNode.condition ? + this.checkBoundCondition(forNode.condition, loopVarName, arraySym) : + false; + + const isVarModifiedBeforeAccess = forNode.statement ? + TypeScriptLinter.checkVarModifiedBeforeNode(forNode.statement, accessExpr, loopVarName) : + false; + + return { isValidBoundCheck, isVarModifiedBeforeAccess }; + } + + private analyzeWhileStatement( + whileNode: ts.WhileStatement, + accessExpr: ts.ElementAccessExpression, + loopVarName: string, + arraySym: ts.Symbol + ): { isValidBoundCheck: boolean; isVarModifiedBeforeAccess: boolean } { + const isValidBoundCheck = whileNode.expression ? + this.checkBoundCondition(whileNode.expression, loopVarName, arraySym) : + false; + + const isVarModifiedBeforeAccess = whileNode.statement ? + TypeScriptLinter.checkVarModifiedBeforeNode(whileNode.statement, accessExpr, loopVarName) : + false; + + return { isValidBoundCheck, isVarModifiedBeforeAccess }; + } + + private analyzeIfStatement( + ifNode: ts.IfStatement, + accessExpr: ts.ElementAccessExpression, + loopVarName: string, + arraySym: ts.Symbol + ): { isValidBoundCheck: boolean; isVarModifiedBeforeAccess: boolean } { + const isValidBoundCheck = ifNode.expression ? + this.checkBoundCondition(ifNode.expression, loopVarName, arraySym) : + false; + + let isVarModifiedBeforeAccess = false; + const statementBlock = ts.isBlock(ifNode.thenStatement) ? ifNode.thenStatement : undefined; + if (statementBlock) { + isVarModifiedBeforeAccess = TypeScriptLinter.checkVarModifiedBeforeNode(statementBlock, accessExpr, loopVarName); + } + + return { isValidBoundCheck, isVarModifiedBeforeAccess }; + } + + private checkBoundCondition( + condition: ts.Expression, + varName: string, + arraySym: ts.Symbol + ): boolean { + if (ts.isBinaryExpression(condition)) { + const { left, right, operatorToken } = condition; + + if (this.checkVarLessThanArrayLength(left, right, operatorToken, varName, arraySym)) { + return true; + } + + if (this.checkArrayLengthGreaterThanVar(left, right, operatorToken, varName, arraySym)) { + return true; + } + + if (ts.isIdentifier(left) && left.text === varName && ts.isNumericLiteral(right)) { + const value = parseFloat(right.text); + if ( + operatorToken.kind === ts.SyntaxKind.GreaterThanEqualsToken && value <= 0 || + operatorToken.kind === ts.SyntaxKind.GreaterThanToken && value < 0 + ) { + return true; + } + } + + return this.checkBoundCondition(left, varName, arraySym) || + this.checkBoundCondition(right, varName, arraySym); + } + + return false; + } + + private checkArrayLengthGreaterThanVar( + left: ts.Expression, + right: ts.Expression, + operatorToken: ts.Token, + varName: string, + arraySym: ts.Symbol + ): boolean { + if ( + ts.isPropertyAccessExpression(left) && + left.name.text === 'length' && + ts.isIdentifier(right) && + right.text === varName + ) { + const leftArraySym = this.tsUtils.trueSymbolAtLocation(left.expression); + if (leftArraySym === arraySym) { + return ( + operatorToken.kind === ts.SyntaxKind.GreaterThanToken || + operatorToken.kind === ts.SyntaxKind.GreaterThanEqualsToken + ); + } + } + return false; + } + + private checkVarLessThanArrayLength( + left: ts.Expression, + right: ts.Expression, + operatorToken: ts.Token, + varName: string, + arraySym: ts.Symbol + ): boolean { + return ( + ts.isIdentifier(left) && + left.text === varName && + ts.isPropertyAccessExpression(right) && + right.name.text === 'length' && + (operatorToken.kind === ts.SyntaxKind.LessThanToken || + operatorToken.kind === ts.SyntaxKind.LessThanEqualsToken) && + this.tsUtils.trueSymbolAtLocation(right.expression) === arraySym + ); + } + + private static traverseNodesUntilTarget( + node: ts.Node, + targetNode: ts.Node, + varName: string, + scopeStack: { shadowed: boolean; localVars: Set }[], + state: { targetFound: boolean; modified: boolean } + ): void { + if (node === targetNode) { + state.targetFound = true; + return; + } + + if (state.targetFound) { + return; + } + + const newScope = this.handleNewScope(node, scopeStack); + + TypeScriptLinter.getVariablesFromScope(node, varName, scopeStack); + + if (this.isVariableModified(node, varName, scopeStack)) { + state.modified = true; + } + + ts.forEachChild(node, (child) => { + this.traverseNodesUntilTarget(child, targetNode, varName, scopeStack, state); + }); + + if (newScope) { + scopeStack.pop(); + } + } + + private static handleNewScope( + node: ts.Node, + scopeStack: { shadowed: boolean; localVars: Set }[] + ): { shadowed: boolean; localVars: Set } | null { + if (ts.isBlock(node) || ts.isFunctionLike(node) || ts.isCatchClause(node)) { + const parentScope = scopeStack[scopeStack.length - 1]; + const newScope = { + shadowed: parentScope.shadowed, + localVars: new Set() + }; + scopeStack.push(newScope); + return newScope; + } + return null; + } + + static getVariablesFromScope( + node: ts.Node, + varName: string, + scopeStack: { shadowed: boolean; localVars: Set }[] + ): void { + if (ts.isVariableDeclaration(node) && + ts.isIdentifier(node.name) && + node.name.text === varName) { + const parent = node.parent; + if (ts.isVariableDeclarationList(parent) && + (parent.flags & ts.NodeFlags.Let || parent.flags & ts.NodeFlags.Const)) { + scopeStack[scopeStack.length - 1].localVars.add(varName); + } + } + + if (ts.isParameter(node) && ts.isIdentifier(node.name) && node.name.text === varName) { + scopeStack[scopeStack.length - 1].localVars.add(varName); + } + } + + private static isVariableModified( + node: ts.Node, + varName: string, + scopeStack: { shadowed: boolean; localVars: Set }[] + ): boolean { + if (!ts.isBinaryExpression(node) || + node.operatorToken.kind !== ts.SyntaxKind.EqualsToken) { + return false; + } + + if (!ts.isIdentifier(node.left) || node.left.text !== varName) { + return false; + } + + for (let i = scopeStack.length - 1; i >= 0; i--) { + if (scopeStack[i].localVars.has(varName)) { + return false; + } + } + + return true; + } + + static checkVarModifiedBeforeNode(container: ts.Node, targetNode: ts.Node, varName: string): boolean { + const scopeStack: { shadowed: boolean; localVars: Set }[] = []; + scopeStack.push({ shadowed: false, localVars: new Set() }); + + const state = { + targetFound: false, + modified: false + }; + + this.traverseNodesUntilTarget(container, targetNode, varName, scopeStack, state); + return state.modified; + } + + static isFunctionCall(node: ts.Node): boolean { + return ts.isCallExpression(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node); + } + + private getArrayAccessInfo(expr: ts.ElementAccessExpression): false | ArrayAccess { + if (!ts.isIdentifier(expr.expression)) { + return false; + } + const baseType = this.tsTypeChecker.getTypeAtLocation(expr.expression); + if (!this.tsUtils.isArray(baseType)) { + return false; + } + const accessArgument = expr.argumentExpression; + + TypeScriptLinter.isFunctionCall(accessArgument); + + const checkNumericType = (node: ts.Node): boolean => { + const argType = this.tsTypeChecker.getTypeAtLocation(node); + return ( + (argType.flags & ts.TypeFlags.NumberLike) !== 0 || + argType.isUnionOrIntersection() && + argType.types.some((t) => { + return t.flags & ts.TypeFlags.NumberLike; + }) + ); + }; + + const isEnumMember = (node: ts.Node): boolean => { + if (ts.isPropertyAccessExpression(node)) { + const symbol = this.tsUtils.trueSymbolAtLocation(node); + return !!symbol && (symbol.flags & ts.SymbolFlags.EnumMember) !== 0; + } + return false; + }; + + if (TypeScriptLinter.isFunctionCall(accessArgument)) { + return false; + } + + if (checkNumericType(accessArgument) || isEnumMember(accessArgument)) { + return { + pos: expr.getEnd(), + accessingIdentifier: accessArgument, + arrayIdent: expr.expression + }; + } + + return false; + } } diff --git a/ets2panda/linter/src/lib/utils/consts/RuntimeCheckAPI.ts b/ets2panda/linter/src/lib/utils/consts/RuntimeCheckAPI.ts index 9fa38ab9fa8dabf173ef922af4e83eb50264daad..738c2b187280a58d968e7a35ae63b8ffa4cd8a0b 100644 --- a/ets2panda/linter/src/lib/utils/consts/RuntimeCheckAPI.ts +++ b/ets2panda/linter/src/lib/utils/consts/RuntimeCheckAPI.ts @@ -17,7 +17,7 @@ import type ts from 'typescript'; export type ArrayAccess = { pos: number; - accessingIdentifier: 'number' | ts.Identifier; + accessingIdentifier: 'number' | ts.Identifier | ts.Expression; arrayIdent: ts.Identifier; }; diff --git a/ets2panda/linter/test/interop/interop_import_js_index.ets.arkts2.json b/ets2panda/linter/test/interop/interop_import_js_index.ets.arkts2.json index 5414e5c1c43e4c950cfe4cd929b5d62d40548533..aa54c2f0ca48c0c451cdfb80bd3974658c803602 100644 --- a/ets2panda/linter/test/interop/interop_import_js_index.ets.arkts2.json +++ b/ets2panda/linter/test/interop/interop_import_js_index.ets.arkts2.json @@ -144,16 +144,6 @@ "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", "severity": "ERROR" }, - { - "line": 24, - "column": 17, - "endLine": 24, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 24, "column": 17, @@ -174,16 +164,6 @@ "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", "severity": "ERROR" }, - { - "line": 25, - "column": 13, - "endLine": 25, - "endColumn": 20, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 25, "column": 13, @@ -234,16 +214,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 27, - "column": 17, - "endLine": 27, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 27, "column": 17, diff --git a/ets2panda/linter/test/interop/interop_import_js_index.ets.autofix.json b/ets2panda/linter/test/interop/interop_import_js_index.ets.autofix.json index 3652409b23fbf7d2b35f03aa6b806a6f48d6f1da..c9d2b8aee79942e93a8c7a095915ecaf9ad973b2 100644 --- a/ets2panda/linter/test/interop/interop_import_js_index.ets.autofix.json +++ b/ets2panda/linter/test/interop/interop_import_js_index.ets.autofix.json @@ -283,16 +283,6 @@ "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", "severity": "ERROR" }, - { - "line": 24, - "column": 17, - "endLine": 24, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 24, "column": 17, @@ -335,16 +325,6 @@ "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", "severity": "ERROR" }, - { - "line": 25, - "column": 13, - "endLine": 25, - "endColumn": 20, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 25, "column": 13, @@ -450,16 +430,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 27, - "column": 17, - "endLine": 27, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 27, "column": 17, diff --git a/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json b/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json index d9f270ec5e6f677618a97014922a8567d43b1ca2..f1127b4da4a392f31b519b47fd7857ee5c69eba5 100644 --- a/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json +++ b/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json @@ -324,16 +324,6 @@ "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", "severity": "ERROR" }, - { - "line": 54, - "column": 3, - "endLine": 54, - "endColumn": 9, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 52, "column": 10, @@ -384,6 +374,16 @@ "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", "severity": "ERROR" }, + { + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 54, "column": 3, diff --git a/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json b/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json index a85d137032e0362398eb7bbc7cce90fccd764b3c..82da66488b96bb1eb7363be7452bb219e2b2937d 100644 --- a/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json +++ b/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json @@ -603,16 +603,6 @@ "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", "severity": "ERROR" }, - { - "line": 54, - "column": 3, - "endLine": 54, - "endColumn": 9, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 52, "column": 10, @@ -707,6 +697,16 @@ "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", "severity": "ERROR" }, + { + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 54, "column": 3, diff --git a/ets2panda/linter/test/main/array_index_expr_type.ets.arkts2.json b/ets2panda/linter/test/main/array_index_expr_type.ets.arkts2.json index 3643204633f2584747bd4fde01082b4531dcfbb4..7fc874bec4a4c06f0570494ceaf6b0686bc831ee 100644 --- a/ets2panda/linter/test/main/array_index_expr_type.ets.arkts2.json +++ b/ets2panda/linter/test/main/array_index_expr_type.ets.arkts2.json @@ -94,6 +94,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 19, "column": 21, @@ -114,6 +124,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 20, + "column": 12, + "endLine": 20, + "endColumn": 33, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 20, "column": 21, @@ -204,16 +224,6 @@ "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", "severity": "ERROR" }, - { - "line": 24, - "column": 11, - "endLine": 24, - "endColumn": 30, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 24, "column": 20, @@ -254,16 +264,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 26, - "column": 11, - "endLine": 26, - "endColumn": 21, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 26, "column": 20, @@ -364,6 +364,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 30, + "column": 11, + "endLine": 30, + "endColumn": 37, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 30, "column": 20, @@ -384,6 +394,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 31, + "column": 11, + "endLine": 31, + "endColumn": 37, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 31, "column": 20, @@ -404,6 +424,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 32, + "column": 11, + "endLine": 32, + "endColumn": 44, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 32, "column": 20, @@ -534,16 +564,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 43, - "column": 1, - "endLine": 43, - "endColumn": 15, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 45, "column": 1, @@ -614,6 +634,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 51, + "column": 1, + "endLine": 51, + "endColumn": 19, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 51, "column": 8, @@ -674,16 +704,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 55, - "column": 15, - "endLine": 55, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 55, "column": 22, @@ -704,16 +724,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 59, - "column": 15, - "endLine": 59, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 62, "column": 22, @@ -754,6 +764,16 @@ "rule": "Enumeration members can be initialized only with compile time expressions of the same type (arkts-no-enum-mixed-types)", "severity": "ERROR" }, + { + "line": 67, + "column": 1, + "endLine": 67, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 67, "column": 6, @@ -764,6 +784,46 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 68, + "column": 1, + "endLine": 68, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 1, + "endLine": 69, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 1, + "endLine": 70, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 71, + "column": 1, + "endLine": 71, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 72, "column": 1, @@ -774,6 +834,26 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 72, + "column": 1, + "endLine": 72, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 73, + "column": 1, + "endLine": 73, + "endColumn": 20, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 73, "column": 6, @@ -856,22 +936,22 @@ }, { "line": 81, - "column": 5, + "column": 1, "endLine": 81, - "endColumn": 17, - "problem": "ArrayIndexExprType", + "endColumn": 18, + "problem": "RuntimeArrayCheck", "suggest": "", - "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 82, - "column": 1, - "endLine": 82, - "endColumn": 7, - "problem": "RuntimeArrayCheck", + "line": 81, + "column": 5, + "endLine": 81, + "endColumn": 17, + "problem": "ArrayIndexExprType", "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, { @@ -884,16 +964,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 83, - "column": 1, - "endLine": 83, - "endColumn": 7, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 83, "column": 10, @@ -904,16 +974,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 84, - "column": 1, - "endLine": 84, - "endColumn": 7, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 84, "column": 10, @@ -924,16 +984,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 85, - "column": 1, - "endLine": 85, - "endColumn": 7, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 85, "column": 10, diff --git a/ets2panda/linter/test/main/array_index_expr_type.ets.autofix.json b/ets2panda/linter/test/main/array_index_expr_type.ets.autofix.json index f3c413339478654d0f37c17c2569396314f8e316..0b12f8e85014bf50aa720843899b843d0dff6cc4 100644 --- a/ets2panda/linter/test/main/array_index_expr_type.ets.autofix.json +++ b/ets2panda/linter/test/main/array_index_expr_type.ets.autofix.json @@ -171,6 +171,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 19, "column": 21, @@ -213,6 +223,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 20, + "column": 12, + "endLine": 20, + "endColumn": 33, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 20, "column": 21, @@ -336,16 +356,6 @@ "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", "severity": "ERROR" }, - { - "line": 24, - "column": 11, - "endLine": 24, - "endColumn": 30, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 24, "column": 20, @@ -397,16 +407,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 26, - "column": 11, - "endLine": 26, - "endColumn": 21, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 26, "column": 20, @@ -573,6 +573,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 30, + "column": 11, + "endLine": 30, + "endColumn": 37, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 30, "column": 20, @@ -615,6 +625,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 31, + "column": 11, + "endLine": 31, + "endColumn": 37, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 31, "column": 20, @@ -657,6 +677,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 32, + "column": 11, + "endLine": 32, + "endColumn": 44, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 32, "column": 20, @@ -897,16 +927,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 43, - "column": 1, - "endLine": 43, - "endColumn": 15, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 45, "column": 1, @@ -1043,6 +1063,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 51, + "column": 1, + "endLine": 51, + "endColumn": 19, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 51, "column": 8, @@ -1169,16 +1199,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 55, - "column": 15, - "endLine": 55, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 55, "column": 22, @@ -1221,16 +1241,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 59, - "column": 15, - "endLine": 59, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 62, "column": 22, @@ -1304,6 +1314,16 @@ "rule": "Enumeration members can be initialized only with compile time expressions of the same type (arkts-no-enum-mixed-types)", "severity": "ERROR" }, + { + "line": 67, + "column": 1, + "endLine": 67, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 67, "column": 6, @@ -1325,6 +1345,46 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 68, + "column": 1, + "endLine": 68, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 1, + "endLine": 69, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 1, + "endLine": 70, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 71, + "column": 1, + "endLine": 71, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 72, "column": 1, @@ -1335,6 +1395,26 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 72, + "column": 1, + "endLine": 72, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 73, + "column": 1, + "endLine": 73, + "endColumn": 20, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 73, "column": 6, @@ -1505,22 +1585,22 @@ }, { "line": 81, - "column": 5, + "column": 1, "endLine": 81, - "endColumn": 17, - "problem": "ArrayIndexExprType", + "endColumn": 18, + "problem": "RuntimeArrayCheck", "suggest": "", - "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 82, - "column": 1, - "endLine": 82, - "endColumn": 7, - "problem": "RuntimeArrayCheck", + "line": 81, + "column": 5, + "endLine": 81, + "endColumn": 17, + "problem": "ArrayIndexExprType", "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, { @@ -1544,16 +1624,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 83, - "column": 1, - "endLine": 83, - "endColumn": 7, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 83, "column": 10, @@ -1575,16 +1645,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 84, - "column": 1, - "endLine": 84, - "endColumn": 7, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 84, "column": 10, @@ -1606,16 +1666,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 85, - "column": 1, - "endLine": 85, - "endColumn": 7, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 85, "column": 10, diff --git a/ets2panda/linter/test/main/array_index_expr_type.ets.migrate.json b/ets2panda/linter/test/main/array_index_expr_type.ets.migrate.json index 12700705c3a2aa039dfe0008091dbab9028f7bdf..457bd6501c90d0816d5491b4ff4f56711124a894 100644 --- a/ets2panda/linter/test/main/array_index_expr_type.ets.migrate.json +++ b/ets2panda/linter/test/main/array_index_expr_type.ets.migrate.json @@ -64,16 +64,6 @@ "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", "severity": "ERROR" }, - { - "line": 24, - "column": 11, - "endLine": 24, - "endColumn": 30, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 24, "column": 20, @@ -104,16 +94,6 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, - { - "line": 26, - "column": 19, - "endLine": 26, - "endColumn": 29, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 26, "column": 28, @@ -134,26 +114,6 @@ "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, - { - "line": 43, - "column": 1, - "endLine": 43, - "endColumn": 15, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, - { - "line": 59, - "column": 15, - "endLine": 59, - "endColumn": 24, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 64, "column": 3, @@ -165,64 +125,84 @@ "severity": "ERROR" }, { - "line": 72, + "line": 68, "column": 1, - "endLine": 72, - "endColumn": 9, - "problem": "IndexNegative", + "endLine": 68, + "endColumn": 12, + "problem": "RuntimeArrayCheck", "suggest": "", - "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", + "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 81, - "column": 5, - "endLine": 81, - "endColumn": 17, - "problem": "ArrayIndexExprType", + "line": 69, + "column": 1, + "endLine": 69, + "endColumn": 9, + "problem": "RuntimeArrayCheck", "suggest": "", - "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 82, + "line": 70, "column": 1, - "endLine": 82, - "endColumn": 7, + "endLine": 70, + "endColumn": 9, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 83, + "line": 71, "column": 1, - "endLine": 83, - "endColumn": 7, + "endLine": 71, + "endColumn": 9, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 84, + "line": 72, "column": 1, - "endLine": 84, - "endColumn": 7, + "endLine": 72, + "endColumn": 9, + "problem": "IndexNegative", + "suggest": "", + "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 1, + "endLine": 72, + "endColumn": 9, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 85, + "line": 81, "column": 1, - "endLine": 85, - "endColumn": 7, + "endLine": 81, + "endColumn": 18, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" + }, + { + "line": 81, + "column": 5, + "endLine": 81, + "endColumn": 17, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" } ] } \ No newline at end of file diff --git a/ets2panda/linter/test/main/index_negative.ets.arkts2.json b/ets2panda/linter/test/main/index_negative.ets.arkts2.json index d8c630fa30f60f14820cf5d891bb906638523cc3..f54cdfc54e404b58e4e80d6bb5afbcd333efac02 100755 --- a/ets2panda/linter/test/main/index_negative.ets.arkts2.json +++ b/ets2panda/linter/test/main/index_negative.ets.arkts2.json @@ -94,6 +94,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 18, + "column": 16, + "endLine": 18, + "endColumn": 28, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 19, "column": 1, @@ -104,6 +114,36 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 19, + "column": 1, + "endLine": 19, + "endColumn": 13, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 13, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 13, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 21, "column": 10, @@ -164,6 +204,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 28, + "column": 9, + "endLine": 28, + "endColumn": 15, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 29, "column": 16, @@ -204,6 +254,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 37, + "column": 1, + "endLine": 37, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 38, "column": 1, @@ -214,6 +274,26 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 38, + "column": 1, + "endLine": 38, + "endColumn": 14, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 1, + "endLine": 39, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 39, "column": 5, @@ -224,6 +304,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 40, + "column": 1, + "endLine": 40, + "endColumn": 14, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 40, "column": 5, @@ -274,6 +364,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 44, + "column": 1, + "endLine": 44, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 44, "column": 5, @@ -284,6 +384,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 45, + "column": 1, + "endLine": 45, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 45, "column": 5, @@ -294,6 +404,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 47, + "column": 1, + "endLine": 47, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 47, "column": 5, @@ -304,6 +424,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 48, + "column": 1, + "endLine": 48, + "endColumn": 14, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 48, "column": 5, @@ -324,6 +454,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 50, + "column": 1, + "endLine": 50, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 50, "column": 5, @@ -344,6 +484,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 52, + "column": 1, + "endLine": 52, + "endColumn": 15, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 52, "column": 5, @@ -384,6 +534,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 54, + "column": 1, + "endLine": 54, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 54, "column": 5, @@ -394,6 +554,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 56, + "column": 1, + "endLine": 56, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 56, "column": 6, @@ -414,6 +584,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 57, + "column": 1, + "endLine": 57, + "endColumn": 29, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 57, "column": 5, @@ -444,6 +624,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 59, + "column": 1, + "endLine": 59, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 59, "column": 5, @@ -464,6 +654,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 60, + "column": 1, + "endLine": 60, + "endColumn": 17, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 60, "column": 5, @@ -484,6 +684,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 61, + "column": 1, + "endLine": 61, + "endColumn": 16, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 61, "column": 5, @@ -504,6 +714,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 63, + "column": 1, + "endLine": 63, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 63, "column": 6, @@ -514,6 +734,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 64, + "column": 1, + "endLine": 64, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 65, "column": 1, @@ -524,6 +754,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 65, + "column": 1, + "endLine": 65, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 65, "column": 5, @@ -544,6 +784,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 66, + "column": 1, + "endLine": 66, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 66, "column": 5, @@ -564,6 +814,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 68, + "column": 1, + "endLine": 68, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 68, "column": 5, @@ -594,6 +854,16 @@ "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", "severity": "ERROR" }, + { + "line": 70, + "column": 1, + "endLine": 70, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 70, "column": 5, @@ -614,6 +884,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 72, + "column": 1, + "endLine": 72, + "endColumn": 31, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 72, "column": 5, @@ -1014,6 +1294,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 89, + "column": 1, + "endLine": 89, + "endColumn": 18, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 89, "column": 5, @@ -1094,6 +1384,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 92, + "column": 1, + "endLine": 92, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 92, "column": 5, @@ -1124,6 +1424,26 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 96, + "column": 11, + "endLine": 96, + "endColumn": 24, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 97, + "column": 11, + "endLine": 97, + "endColumn": 25, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 97, "column": 15, @@ -1164,6 +1484,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 99, + "column": 1, + "endLine": 99, + "endColumn": 25, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 99, "column": 5, @@ -1184,6 +1514,16 @@ "rule": "The index expression must be zero or positive value.(arkts-array-index-negative)", "severity": "ERROR" }, + { + "line": 100, + "column": 1, + "endLine": 100, + "endColumn": 19, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 100, "column": 5, diff --git a/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json b/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json index d7c46831b14d25e64f496f10c4261b2b9f132733..45fd91e9b0cb412ad02fc0c8bf4d9dec81e5d284 100755 --- a/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json +++ b/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json @@ -474,16 +474,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 107, - "column": 9, - "endLine": 107, - "endColumn": 19, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 107, "column": 18, diff --git a/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json b/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json index 5045e3f3cb2e3b1e3277ea34162c1b85a723a673..53e5d662477ad41a71d35bb7d0e74e520276181d 100644 --- a/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json +++ b/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json @@ -1011,16 +1011,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 107, - "column": 9, - "endLine": 107, - "endColumn": 19, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 107, "column": 18, diff --git a/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json b/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json index e61c55a40d4fc588a8198f34b1efaf9c10b06728..665c1dea057b93e293c9171fa2397e962d108f95 100644 --- a/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json +++ b/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json @@ -24,16 +24,6 @@ "rule": "Definite assignment assertions are not supported (arkts-no-definite-assignment)", "severity": "ERROR" }, - { - "line": 110, - "column": 17, - "endLine": 110, - "endColumn": 27, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 110, "column": 26, diff --git a/ets2panda/linter/test/main/runtime_array_bound.ets b/ets2panda/linter/test/main/runtime_array_bound.ets index 435c6ac0e6817708630365cdac50f50fdb0b8e78..55402651662922da880b103f075b670737a3ff60 100644 --- a/ets2panda/linter/test/main/runtime_array_bound.ets +++ b/ets2panda/linter/test/main/runtime_array_bound.ets @@ -86,5 +86,82 @@ newIndex = 22; arr10[newIndex]; +let arr = [0, 1, 2, 3, 4, 5] +for(let i = 0; i < arr.length; i++) { +arr[i] = arr[i] + 1; +} +for(let i = 0; i < arr.length; i++) { +i = 10; +arr[i] = arr[i] + 1; +} + +let arr = [0, 1, 2, 3, 4, 5] +let idx = 2; +if(idx > 0 && idx < arr.length) { +arr[idx] = arr[idx] + 1; +} +if(idx > 0 && idx < arr.length) { +idx = 10; +arr[idx] = arr[idx] + 1; +} + +let arr = [0, 1, 2, 3, 4, 5] +let idx = 0; +while(idx > 0 && idx < arr.length) { +arr[idx] = arr[idx] + 1; +idx++; +idx = 10; +} +while(idx > 0 && idx < arr.length) { +idx = 10; +arr[idx] = arr[idx] + 1; +} + +let arr = [0, 1, 2, 3, 4, 5] +let idx = 0; +arr[idx]; +arr[10]; +if (arr.length > 10) { +arr[10] = 10; +} + +function foo():int{ +return 1; +} +arr[44/3]; +arr[foo()]; +arr[()=>{return 1}]; +if(arr.length > foo()) { +arr[foo()]; +} +if(arr.length > 44/3) { +arr[4*4/3]; +} + +let arr1:number[] = [1, 1.5,45,2] + +function foo(i:number):number{ + return i; +} + +arr1[3*5] = 23; +arr1[parseInt("16")] = 23; +arr1[foo(16)] = 23 + +let arr1:number[] = [1, 1.5,45,2] + +arr1[Number.MAX_VALUE] = 23; +arr1[Number.MAX_SAFE_INTEGER] = 23; + +let arr1:number[] = [1, 1.5,45,2] +function foo(i:number):number{ + return i; +} +arr1[(24)] = 23; +arr1[+24] = 23; +enum TE{ + AA = 12 +} +arr1[TE.AA] = 12; diff --git a/ets2panda/linter/test/main/runtime_array_bound.ets.arkts2.json b/ets2panda/linter/test/main/runtime_array_bound.ets.arkts2.json index ee17b482f008213a6ee5cdd32b3dd9d4964579b9..43257dd5828f36dcdada84df96be21c1b2ff42b3 100644 --- a/ets2panda/linter/test/main/runtime_array_bound.ets.arkts2.json +++ b/ets2panda/linter/test/main/runtime_array_bound.ets.arkts2.json @@ -144,16 +144,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 29, - "column": 5, - "endLine": 29, - "endColumn": 13, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 28, "column": 10, @@ -184,6 +174,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 29, + "column": 5, + "endLine": 29, + "endColumn": 13, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 32, "column": 22, @@ -224,16 +224,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 34, - "column": 5, - "endLine": 34, - "endColumn": 13, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 33, "column": 10, @@ -254,6 +244,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 13, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 37, "column": 22, @@ -304,16 +304,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 40, - "column": 5, - "endLine": 40, - "endColumn": 12, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 39, "column": 10, @@ -374,16 +364,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 45, - "column": 5, - "endLine": 45, - "endColumn": 12, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 44, "column": 10, @@ -414,6 +394,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 45, + "column": 5, + "endLine": 45, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 49, "column": 22, @@ -464,6 +454,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 51, + "column": 5, + "endLine": 51, + "endColumn": 13, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 54, "column": 22, @@ -514,6 +514,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 59, + "column": 1, + "endLine": 59, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { "line": 61, "column": 22, @@ -584,16 +594,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 67, - "column": 1, - "endLine": 67, - "endColumn": 12, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 69, "column": 22, @@ -634,16 +634,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 71, - "column": 5, - "endLine": 71, - "endColumn": 16, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 70, "column": 19, @@ -704,16 +694,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 76, - "column": 5, - "endLine": 76, - "endColumn": 10, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, { "line": 75, "column": 13, @@ -803,6 +783,1066 @@ "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" + }, + { + "line": 89, + "column": 5, + "endLine": 89, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 12, + "endLine": 89, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 15, + "endLine": 89, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 18, + "endLine": 89, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 21, + "endLine": 89, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 24, + "endLine": 89, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 27, + "endLine": 89, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 9, + "endLine": 90, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 90, + "column": 13, + "endLine": 90, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 91, + "column": 19, + "endLine": 91, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 9, + "endLine": 93, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 13, + "endLine": 93, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 94, + "column": 5, + "endLine": 94, + "endColumn": 7, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 1, + "endLine": 95, + "endColumn": 7, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 10, + "endLine": 95, + "endColumn": 16, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 19, + "endLine": 95, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 5, + "endLine": 98, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 12, + "endLine": 98, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 15, + "endLine": 98, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 18, + "endLine": 98, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 21, + "endLine": 98, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 24, + "endLine": 98, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 27, + "endLine": 98, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 99, + "column": 5, + "endLine": 99, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 99, + "column": 11, + "endLine": 99, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 100, + "column": 10, + "endLine": 100, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 101, + "column": 23, + "endLine": 101, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 103, + "column": 10, + "endLine": 103, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 104, + "column": 7, + "endLine": 104, + "endColumn": 9, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 105, + "column": 1, + "endLine": 105, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 105, + "column": 12, + "endLine": 105, + "endColumn": 20, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 105, + "column": 23, + "endLine": 105, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 5, + "endLine": 108, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 12, + "endLine": 108, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 15, + "endLine": 108, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 18, + "endLine": 108, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 21, + "endLine": 108, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 24, + "endLine": 108, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 108, + "column": 27, + "endLine": 108, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 109, + "column": 5, + "endLine": 109, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 109, + "column": 11, + "endLine": 109, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 110, + "column": 13, + "endLine": 110, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 111, + "column": 23, + "endLine": 111, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 113, + "column": 7, + "endLine": 113, + "endColumn": 9, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 115, + "column": 13, + "endLine": 115, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 116, + "column": 7, + "endLine": 116, + "endColumn": 9, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 1, + "endLine": 117, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 12, + "endLine": 117, + "endColumn": 20, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 23, + "endLine": 117, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 5, + "endLine": 120, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 12, + "endLine": 120, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 15, + "endLine": 120, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 18, + "endLine": 120, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 21, + "endLine": 120, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 24, + "endLine": 120, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 27, + "endLine": 120, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 121, + "column": 5, + "endLine": 121, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 121, + "column": 11, + "endLine": 121, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 122, + "column": 1, + "endLine": 122, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 123, + "column": 1, + "endLine": 123, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 124, + "column": 18, + "endLine": 124, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 125, + "column": 1, + "endLine": 125, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 125, + "column": 11, + "endLine": 125, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 128, + "column": 1, + "endLine": 130, + "endColumn": 2, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 129, + "column": 8, + "endLine": 129, + "endColumn": 9, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 132, + "column": 1, + "endLine": 132, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 132, + "column": 5, + "endLine": 132, + "endColumn": 9, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 133, + "column": 1, + "endLine": 133, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 134, + "column": 1, + "endLine": 134, + "endColumn": 20, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 134, + "column": 5, + "endLine": 134, + "endColumn": 19, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 136, + "column": 1, + "endLine": 136, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 138, + "column": 17, + "endLine": 138, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 138, + "column": 20, + "endLine": 138, + "endColumn": 21, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 139, + "column": 1, + "endLine": 139, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 139, + "column": 5, + "endLine": 139, + "endColumn": 10, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 142, + "column": 22, + "endLine": 142, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 142, + "column": 29, + "endLine": 142, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 142, + "column": 32, + "endLine": 142, + "endColumn": 33, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 144, + "column": 1, + "endLine": 146, + "endColumn": 2, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 148, + "column": 1, + "endLine": 148, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 148, + "column": 13, + "endLine": 148, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 149, + "column": 1, + "endLine": 149, + "endColumn": 21, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 149, + "column": 6, + "endLine": 149, + "endColumn": 20, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 149, + "column": 24, + "endLine": 149, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 150, + "column": 1, + "endLine": 150, + "endColumn": 14, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 150, + "column": 6, + "endLine": 150, + "endColumn": 13, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 150, + "column": 17, + "endLine": 150, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 152, + "column": 22, + "endLine": 152, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 152, + "column": 29, + "endLine": 152, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 152, + "column": 32, + "endLine": 152, + "endColumn": 33, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 154, + "column": 1, + "endLine": 154, + "endColumn": 23, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 154, + "column": 6, + "endLine": 154, + "endColumn": 22, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 154, + "column": 26, + "endLine": 154, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 155, + "column": 1, + "endLine": 155, + "endColumn": 30, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 155, + "column": 6, + "endLine": 155, + "endColumn": 29, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 155, + "column": 33, + "endLine": 155, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 157, + "column": 22, + "endLine": 157, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 157, + "column": 29, + "endLine": 157, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 157, + "column": 32, + "endLine": 157, + "endColumn": 33, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 1, + "endLine": 160, + "endColumn": 2, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 161, + "column": 1, + "endLine": 161, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 161, + "column": 14, + "endLine": 161, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 162, + "column": 1, + "endLine": 162, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 162, + "column": 13, + "endLine": 162, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 166, + "column": 1, + "endLine": 166, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 166, + "column": 15, + "endLine": 166, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" } ] } \ No newline at end of file diff --git a/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.ets b/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.ets index 3ac6cbf3433c32bd8b7df05ca36ab3d12d5ccd01..ef82a08bc065e94ecb21ea87c1bdfc082a8e5fbb 100644 --- a/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.ets +++ b/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.ets @@ -86,5 +86,82 @@ newIndex = 22.0; arr10[newIndex as int]; +let arr: number[] = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] +for(let i: number = 0.0; i < arr.length; i++) { +arr[i as int] = arr[i as int] + 1.0; +} +for(let i: number = 0.0; i < arr.length; i++) { +i = 10.0; +arr[i as int] = arr[i as int] + 1.0; +} + +let arr: number[] = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] +let idx: number = 2.0; +if(idx > 0.0 && idx < arr.length) { +arr[idx as int] = arr[idx as int] + 1.0; +} +if(idx > 0.0 && idx < arr.length) { +idx = 10.0; +arr[idx as int] = arr[idx as int] + 1.0; +} + +let arr: number[] = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] +let idx: number = 0.0; +while(idx > 0.0 && idx < arr.length) { +arr[idx as int] = arr[idx as int] + 1.0; +idx++; +idx = 10.0; +} +while(idx > 0.0 && idx < arr.length) { +idx = 10.0; +arr[idx as int] = arr[idx as int] + 1.0; +} + +let arr: number[] = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] +let idx: number = 0.0; +arr[idx as int]; +arr[10]; +if (arr.length > 10.0) { +arr[10] = 10.0; +} + +function foo():int{ +return 1.0; +} +arr[(44/3) as int]; +arr[foo()]; +arr[()=>{return 1}]; +if(arr.length > foo()) { +arr[foo()]; +} +if(arr.length > 44.0/3.0) { +arr[(4*4/3) as int]; +} + +let arr1:number[] = [1.0, 1.5,45.0,2.0] + +function foo(i:number):number{ + return i; +} + +arr1[3*5] = 23.0; +arr1[parseInt("16") as int] = 23.0; +arr1[foo(16) as int] = 23.0 + +let arr1:number[] = [1.0, 1.5,45.0,2.0] + +arr1[Number.MAX_VALUE as int] = 23.0; +arr1[Number.MAX_SAFE_INTEGER as int] = 23.0; + +let arr1:number[] = [1.0, 1.5,45.0,2.0] +function foo(i:number):number{ + return i; +} +arr1[(24)] = 23.0; +arr1[+24] = 23.0; +enum TE{ + AA = 12 +} +arr1[TE.AA] = 12.0; diff --git a/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.json b/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.json index 2801165e5d8611744782d6aaaccc8604be228967..a5dcce18b3aeada1bc7e878cffcfa0693bb07477 100644 --- a/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.json +++ b/ets2panda/linter/test/main/runtime_array_bound.ets.migrate.json @@ -35,44 +35,154 @@ "severity": "ERROR" }, { - "line": 40, + "line": 51, "column": 5, - "endLine": 40, - "endColumn": 12, + "endLine": 51, + "endColumn": 13, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 67, + "line": 59, "column": 1, - "endLine": 67, - "endColumn": 12, + "endLine": 59, + "endColumn": 9, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 71, - "column": 5, - "endLine": 71, - "endColumn": 16, + "line": 123, + "column": 1, + "endLine": 123, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 125, + "column": 1, + "endLine": 125, + "endColumn": 8, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 128, + "column": 1, + "endLine": 130, + "endColumn": 2, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 133, + "column": 1, + "endLine": 133, + "endColumn": 11, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" }, { - "line": 76, + "line": 134, + "column": 1, + "endLine": 134, + "endColumn": 20, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 134, "column": 5, - "endLine": 76, + "endLine": 134, + "endColumn": 19, + "problem": "ArrayIndexExprType", + "suggest": "", + "rule": "The index expression must be of a numeric type (arkts-array-index-expr-type)", + "severity": "ERROR" + }, + { + "line": 136, + "column": 1, + "endLine": 136, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 144, + "column": 1, + "endLine": 146, + "endColumn": 2, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 148, + "column": 1, + "endLine": 148, + "endColumn": 10, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 1, + "endLine": 160, + "endColumn": 2, + "problem": "TsOverload", + "suggest": "", + "rule": "Class TS overloading is not supported(arkts-no-ts-overload)", + "severity": "ERROR" + }, + { + "line": 161, + "column": 1, + "endLine": 161, + "endColumn": 11, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 162, + "column": 1, + "endLine": 162, "endColumn": 10, "problem": "RuntimeArrayCheck", "suggest": "", "rule": "Array bound not checked. (arkts-runtime-array-check)", "severity": "ERROR" + }, + { + "line": 166, + "column": 1, + "endLine": 166, + "endColumn": 12, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" } ] }