flow-remove-types produces invalid JS after non-latin characters
Open
bug
parsing
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Flow version: 0.100.0
## Expected behavior
Given the following input:
```js
// @flow
// п
function foo(bar: number) {}
```
`flow-remove-types` should produce:
```js
//
// п
function foo(bar ) {}
```
## Actual behavior
It produces invalid JS:
```js
//
// п
function foo(bar: {}
```
The non-latin character is the trigger. Without it, it works correctly. This seems like quite a serious bug considering how common it is to use non-latin characters in comments (e.g. comment in other languages, draw arrows etc.).
cc @mroch @samwgoldman
Contributor guide
Assessment
This issue has not been assessed yet.