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

Using constructor redirects versus => results in different formatting #557

Closed
matanlurey opened this issue Nov 24, 2016 · 4 comments
Closed

Comments

@matanlurey
Copy link
Contributor

Similar formatting issue as #548.

With a constructor redirect, nice!

const factory PublicType.constructor(
  String a,
  Type b,
) = PublicTypeImpl._;

With =>, sadface

factory PublicType.constructor(
    String a,
    Type b,
  ) =>
      new PublicTypeImpl._(a, b);
@munificent
Copy link
Member

Ugh, I'm going to spend the rest of my life dealing with corner cases in the interactions between trailing commas and the rest of the language. :(

@srawlins
Copy link
Member

FWIW I think this is fixed with the new tall style. Changing the examples a bit:

class PublicType {
  const factory PublicType.constructor1234567890121416182022242628303234363840(
    a,
    b,
  ) = PublicTypeImpl._;

  factory PublicType.constructor1234567890121416182022242628303234363840(
    a,
    b,
  ) => new PublicTypeImpl._(a, b);

  const factory PublicType.constructor(a, b) =
      PublicTypeImpl._1234567890121416182022242628303234363840;

  factory PublicType.constructor(a, b) =>
      new PublicTypeImpl._1234567890121416182022242628303234363840(a, b);
}

@munificent
Copy link
Member

FWIW I think this is fixed with the new tall style.

Once we're a little closer to shipping, I plan to go through the issue tracker and close out issues that are made irrelevant by the new style. Thanks for starting that work already. :)

@munificent
Copy link
Member

As @srawlins notes, this is looking good in the forthcoming tall style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants