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 formatting with type casting and intersection type when lines exceed a certain length #47

Closed
nweldev opened this issue Aug 30, 2017 · 1 comment

Comments

@nweldev
Copy link

nweldev commented Aug 30, 2017

this is a bug with

clang-format: 1.0.35

config

Language:        JavaScript
BasedOnStyle:    Google
ColumnLimit:     140

input

        const resp = new Response(new ResponseOptions({
          type: ResponseType.Error, status: 404, body: { error: 'Object Not Found' }
        })) as Response & Error;

        const resp2 = new Response(new ResponseOptions({
          type: ResponseType.Error, status: 404, body: { messages: [message] }
        })) as Response & Error;

output

           // bad result
           const resp = new Response(new ResponseOptions({type: ResponseType.Error, status: 404, body: {error: 'Object Not Found'}}))
                            as Response &
               Error;

           // good result
           const resp2 =
               new Response(new ResponseOptions({type: ResponseType.Error, status: 404, body: {messages: [message]}})) as Response & Error;
@nweldev
Copy link
Author

nweldev commented Apr 9, 2018

PR & Issues spring-cleaning: I no longer face the problem, and the discussion on this topic is no longer active, so I close this issue / PR. Feel free to reopen it if necessary.

@nweldev nweldev closed this as completed Apr 9, 2018
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

1 participant