JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsFunctionDeclaration { async_token: missing (optional), function_token: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { name_token: IDENT@9..10 "a" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@10..11 "(" [] [], items: JsParameterList [ JsFormalParameter { decorators: JsDecoratorList [], binding: JsIdentifierBinding { name_token: IDENT@11..12 "x" [] [], }, question_mark_token: QUESTION@12..13 "?" [] [], type_annotation: TsTypeAnnotation { colon_token: COLON@13..15 ":" [] [Whitespace(" ")], ty: TsStringType { string_token: STRING_KW@15..22 "string" [] [Whitespace(" ")], }, }, initializer: JsInitializerClause { eq_token: EQ@22..24 "=" [] [Whitespace(" ")], expression: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@24..30 "\"test\"" [] [], }, }, }, ], r_paren_token: R_PAREN@30..32 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@32..33 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], r_curly_token: R_CURLY@33..34 "}" [] [], }, }, JsFunctionDeclaration { async_token: missing (optional), function_token: FUNCTION_KW@34..44 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { name_token: IDENT@44..45 "b" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@45..46 "(" [] [], items: JsParameterList [ JsBogusParameter { items: [ JsDecoratorList [], DOT3@46..49 "..." [] [], JsIdentifierBinding { name_token: IDENT@49..53 "rest" [] [], }, TsTypeAnnotation { colon_token: COLON@53..55 ":" [] [Whitespace(" ")], ty: TsArrayType { element_type: TsStringType { string_token: STRING_KW@55..61 "string" [] [], }, l_brack_token: L_BRACK@61..62 "[" [] [], r_brack_token: R_BRACK@62..64 "]" [] [Whitespace(" ")], }, }, JsInitializerClause { eq_token: EQ@64..66 "=" [] [Whitespace(" ")], expression: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@66..72 "\"init\"" [] [], }, }, ], }, ], r_paren_token: R_PAREN@72..74 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@74..75 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], r_curly_token: R_CURLY@75..76 "}" [] [], }, }, JsFunctionDeclaration { async_token: missing (optional), function_token: FUNCTION_KW@76..86 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { name_token: IDENT@86..87 "c" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@87..88 "(" [] [], items: JsParameterList [ JsBogusParameter { items: [ JsDecoratorList [], DOT3@88..91 "..." [] [], JsIdentifierBinding { name_token: IDENT@91..95 "rest" [] [], }, ], }, COMMA@95..97 "," [] [Whitespace(" ")], JsFormalParameter { decorators: JsDecoratorList [], binding: JsIdentifierBinding { name_token: IDENT@97..98 "b" [] [], }, question_mark_token: missing (optional), type_annotation: TsTypeAnnotation { colon_token: COLON@98..100 ":" [] [Whitespace(" ")], ty: TsStringType { string_token: STRING_KW@100..106 "string" [] [], }, }, initializer: missing (optional), }, ], r_paren_token: R_PAREN@106..108 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@108..109 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], r_curly_token: R_CURLY@109..110 "}" [] [], }, }, ], eof_token: EOF@110..111 "" [Newline("\n")] [], } 0: JS_MODULE@0..111 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..110 0: JS_FUNCTION_DECLARATION@0..34 0: (empty) 1: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")] 2: (empty) 3: JS_IDENTIFIER_BINDING@9..10 0: IDENT@9..10 "a" [] [] 4: (empty) 5: JS_PARAMETERS@10..32 0: L_PAREN@10..11 "(" [] [] 1: JS_PARAMETER_LIST@11..30 0: JS_FORMAL_PARAMETER@11..30 0: JS_DECORATOR_LIST@11..11 1: JS_IDENTIFIER_BINDING@11..12 0: IDENT@11..12 "x" [] [] 2: QUESTION@12..13 "?" [] [] 3: TS_TYPE_ANNOTATION@13..22 0: COLON@13..15 ":" [] [Whitespace(" ")] 1: TS_STRING_TYPE@15..22 0: STRING_KW@15..22 "string" [] [Whitespace(" ")] 4: JS_INITIALIZER_CLAUSE@22..30 0: EQ@22..24 "=" [] [Whitespace(" ")] 1: JS_STRING_LITERAL_EXPRESSION@24..30 0: JS_STRING_LITERAL@24..30 "\"test\"" [] [] 2: R_PAREN@30..32 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@32..34 0: L_CURLY@32..33 "{" [] [] 1: JS_DIRECTIVE_LIST@33..33 2: JS_STATEMENT_LIST@33..33 3: R_CURLY@33..34 "}" [] [] 1: JS_FUNCTION_DECLARATION@34..76 0: (empty) 1: FUNCTION_KW@34..44 "function" [Newline("\n")] [Whitespace(" ")] 2: (empty) 3: JS_IDENTIFIER_BINDING@44..45 0: IDENT@44..45 "b" [] [] 4: (empty) 5: JS_PARAMETERS@45..74 0: L_PAREN@45..46 "(" [] [] 1: JS_PARAMETER_LIST@46..72 0: JS_BOGUS_PARAMETER@46..72 0: JS_DECORATOR_LIST@46..46 1: DOT3@46..49 "..." [] [] 2: JS_IDENTIFIER_BINDING@49..53 0: IDENT@49..53 "rest" [] [] 3: TS_TYPE_ANNOTATION@53..64 0: COLON@53..55 ":" [] [Whitespace(" ")] 1: TS_ARRAY_TYPE@55..64 0: TS_STRING_TYPE@55..61 0: STRING_KW@55..61 "string" [] [] 1: L_BRACK@61..62 "[" [] [] 2: R_BRACK@62..64 "]" [] [Whitespace(" ")] 4: JS_INITIALIZER_CLAUSE@64..72 0: EQ@64..66 "=" [] [Whitespace(" ")] 1: JS_STRING_LITERAL_EXPRESSION@66..72 0: JS_STRING_LITERAL@66..72 "\"init\"" [] [] 2: R_PAREN@72..74 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@74..76 0: L_CURLY@74..75 "{" [] [] 1: JS_DIRECTIVE_LIST@75..75 2: JS_STATEMENT_LIST@75..75 3: R_CURLY@75..76 "}" [] [] 2: JS_FUNCTION_DECLARATION@76..110 0: (empty) 1: FUNCTION_KW@76..86 "function" [Newline("\n")] [Whitespace(" ")] 2: (empty) 3: JS_IDENTIFIER_BINDING@86..87 0: IDENT@86..87 "c" [] [] 4: (empty) 5: JS_PARAMETERS@87..108 0: L_PAREN@87..88 "(" [] [] 1: JS_PARAMETER_LIST@88..106 0: JS_BOGUS_PARAMETER@88..95 0: JS_DECORATOR_LIST@88..88 1: DOT3@88..91 "..." [] [] 2: JS_IDENTIFIER_BINDING@91..95 0: IDENT@91..95 "rest" [] [] 1: COMMA@95..97 "," [] [Whitespace(" ")] 2: JS_FORMAL_PARAMETER@97..106 0: JS_DECORATOR_LIST@97..97 1: JS_IDENTIFIER_BINDING@97..98 0: IDENT@97..98 "b" [] [] 2: (empty) 3: TS_TYPE_ANNOTATION@98..106 0: COLON@98..100 ":" [] [Whitespace(" ")] 1: TS_STRING_TYPE@100..106 0: STRING_KW@100..106 "string" [] [] 4: (empty) 2: R_PAREN@106..108 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@108..110 0: L_CURLY@108..109 "{" [] [] 1: JS_DIRECTIVE_LIST@109..109 2: JS_STATEMENT_LIST@109..109 3: R_CURLY@109..110 "}" [] [] 4: EOF@110..111 "" [Newline("\n")] [] -- ts_formal_parameter_error.ts:1:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Parameter cannot have question mark and initializer > 1 │ function a(x?: string = "test") {} │ ^^^^^^^^ 2 │ function b(...rest: string[] = "init") {} 3 │ function c(...rest, b: string) {} -- ts_formal_parameter_error.ts:2:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest elements may not have default initializers 1 │ function a(x?: string = "test") {} > 2 │ function b(...rest: string[] = "init") {} │ ^^^^^^^^ 3 │ function c(...rest, b: string) {} 4 │ -- ts_formal_parameter_error.ts:3:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest elements may not have trailing commas 1 │ function a(x?: string = "test") {} 2 │ function b(...rest: string[] = "init") {} > 3 │ function c(...rest, b: string) {} │ ^^^^^^^ 4 │ -- function a(x?: string = "test") {} function b(...rest: string[] = "init") {} function c(...rest, b: string) {}