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 of class extends expression #34

Open
jbms opened this issue Jun 30, 2016 · 1 comment
Open

Incorrect formatting of class extends expression #34

jbms opened this issue Jun 30, 2016 · 1 comment

Comments

@jbms
Copy link

jbms commented Jun 30, 2016

clang-format does not handle class definitions where the extends clause is an expression more complicated than a sequence of dot-separated identifiers:

Expected output:

function identity<T>(x: T) {
  return x;
}
class A {};
class B extends (A) {};
class C extends identity(A) {};

Actual output:

function identity<T>(x: T) {
  return x;
}
class A {};
class B extends
(A){};
class C extends identity
(A){};
@valdrinkoshi
Copy link

Any update on this issue?
I confirm this is still an issue, e.g. trying to use mixins like this

const MyMixin = (BaseClass) => class extends BaseClass {};
class MyClass extends MyMixin(HTMLElement) {}

results in this output:

const MyMixin = (BaseClass) => class extends BaseClass {};
class MyClass extends MyMixin
(HTMLElement) {
}

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