Skip to content

Commit

Permalink
fix(ts): fix typed error
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 15, 2022
1 parent ddd139e commit 77399ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ formalParameterList
formalParameterArg
: decorator? accessibilityModifier? identifierOrKeyWord '?'? typeAnnotation? ('=' singleExpression)? // ECMAScript 6: Initialization
| lastFormalParameterArg
| arrayLiteral // ECMAScript 6: Parameter Context Matching
// ([key, value]: [string, string[]])
| arrayLiteral (':' formalParameterList)? // ECMAScript 6: Parameter Context Matching
| objectLiteral (':' formalParameterList)? // ECMAScript 6: Parameter Context Matching
// `addThing({ payload }, { call }){}`
| objectLiteral (',' objectLiteral)* // ECMAScript 6: Parameter Context Matching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,13 @@ import {EMPTY, Observable, of} from 'rxjs';
} """
TypeScriptAnalyser().analysis(code, "index.tsx")
}

@Test
fun nested_type_type_error() {
val code = """Object.entries(values).forEach(([key, value]: [string, string[]]) => {
});
"""
TypeScriptAnalyser().analysis(code, "index.tsx")
}
}

0 comments on commit 77399ac

Please sign in to comment.