File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
internal/transformers/declarations Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -468,10 +468,13 @@ func (tx *DeclarationTransformer) visitDeclarationSubtree(input *ast.Node) *ast.
468
468
case ast .KindTupleType :
469
469
result = tx .Visitor ().VisitEachChild (input )
470
470
if result != nil {
471
- startLine , _ := scanner .GetLineAndCharacterOfPosition (tx .state .currentSourceFile , input .Loc .Pos ())
472
- endLine , _ := scanner .GetLineAndCharacterOfPosition (tx .state .currentSourceFile , input .Loc .End ())
473
- if startLine == endLine {
474
- tx .EmitContext ().AddEmitFlags (result , printer .EFSingleLine )
471
+ nodeSourceFile := ast .GetSourceFileOfNode (input )
472
+ if nodeSourceFile != nil {
473
+ startLine , _ := scanner .GetLineAndCharacterOfPosition (nodeSourceFile , input .Loc .Pos ())
474
+ endLine , _ := scanner .GetLineAndCharacterOfPosition (nodeSourceFile , input .Loc .End ())
475
+ if startLine == endLine {
476
+ tx .EmitContext ().AddEmitFlags (result , printer .EFSingleLine )
477
+ }
475
478
}
476
479
}
477
480
case ast .KindJSDocTypeExpression :
You can’t perform that action at this time.
0 commit comments