@@ -460,14 +460,12 @@ export class FunctionParameterExpression extends Expression {
460460 const results = [ this . name . text ] as TranspileResult ;
461461
462462 if ( this . defaultValue ) {
463- results . push ( ' = ' , ...this . defaultValue . transpile ( state ) ) ;
463+ results . push ( ' = ' , ...( this . defaultValue . getTypedef ( state ) ?? this . defaultValue . transpile ( state ) ) ) ;
464464 }
465465
466466 if ( this . asToken ) {
467467 results . push ( ' as ' ) ;
468468
469- // TODO: Is this conditional needed? Will typeToken always exist
470- // so long as `asToken` exists?
471469 if ( this . typeToken ) {
472470 results . push ( this . typeToken . text ) ;
473471 }
@@ -581,6 +579,15 @@ export class DottedGetExpression extends Expression {
581579 }
582580 }
583581
582+ getTypedef ( state : BrsTranspileState ) {
583+ //always transpile the dots for typedefs
584+ return [
585+ ...this . obj . transpile ( state ) ,
586+ state . transpileToken ( this . dot ) ,
587+ state . transpileToken ( this . name )
588+ ] ;
589+ }
590+
584591 walk ( visitor : WalkVisitor , options : WalkOptions ) {
585592 if ( options . walkMode & InternalWalkMode . walkExpressions ) {
586593 walk ( this , 'obj' , visitor , options ) ;
@@ -1132,6 +1139,12 @@ export class VariableExpression extends Expression {
11321139 return result ;
11331140 }
11341141
1142+ getTypedef ( state : BrsTranspileState ) {
1143+ return [
1144+ state . transpileToken ( this . name )
1145+ ] ;
1146+ }
1147+
11351148 walk ( visitor : WalkVisitor , options : WalkOptions ) {
11361149 //nothing to walk
11371150 }
0 commit comments