Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect format for a type with template followed by an equals sign. #46

Closed
Goodwine opened this issue Aug 29, 2017 · 1 comment
Closed

Comments

@Goodwine
Copy link

When a template thingy is followed by an equals sign, clang-format thinks it's a less-than-or-equal-to operator and formats things weird.

This

class Something<T> {};

let a: Something<string>=new Something<string>();
let b: Something<string> =new Something<string>();

becomes this

class Something<T> {};

let a: Something < string >= new Something<string>();
let b: Something<string> = new Something<string>();
@mprobst
Copy link
Contributor

mprobst commented Aug 29, 2017

Known issue. I'm actually quite surprised this is valid TS to begin with, unparsing the >= into separate tokens is tricky. This is too hard to fix for us, as we cannot know when to split >= before actual parsing, which is way too late in the tool stage. My suggestion is not to write code like that :-)

@mprobst mprobst closed this as completed Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants