Skip to content

Implement support for generic function types #563

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

Closed
floitschG opened this issue Dec 2, 2016 · 13 comments
Closed

Implement support for generic function types #563

floitschG opened this issue Dec 2, 2016 · 13 comments

Comments

@floitschG
Copy link

This is the formatter issue for dart-lang/sdk#27527.

At the moment we only really need the new syntax in typedefs. Eventually, we want to make this syntax usable for fields and locals, but it's not yet as high a priority. If you find the time to make it work there too, please guard it behind a (different) flag.

@munificent
Copy link
Member

If you find the time to make it work there too, please guard it behind a (different) flag.

Generally, for the formatter, I don't put new syntax behind explicit flags. Instead, if you throw an AST at dartfmt that uses the new syntax, it will try to handle it. Since all dartfmt does is rearrange whitespace, I don't think we have to worry too much about compatibility on experimental language features—if a feature is changed or removed, people will stop formatting code that uses it.

@floitschG
Copy link
Author

That sounds reasonable. I copied this from the other bugs, but I agree that it doesn't really apply to the formatter.

@mit-mit
Copy link
Member

mit-mit commented Dec 15, 2016

Moving to 1.22 for implementation, informal spec is linked from the meta-issue dart-lang/sdk#27527

@munificent
Copy link
Member

Thanks!

@mit-mit
Copy link
Member

mit-mit commented Jan 18, 2017

@munificent is this done? If so, was it merged to the sdk?

@munificent
Copy link
Member

No, this is blocked on analyzer support. dart_style uses analyzer's parser so if there isn't a version of analyzer that parses some syntax, it can't format it. Once dart-lang/sdk#27969 is done, I'll add support to dartfmt.

@mit-mit
Copy link
Member

mit-mit commented Jan 19, 2017

OK. Please note that dart-lang/sdk#27969 was punted to 1.23!

@munificent
Copy link
Member

Good to know, thanks!

@mit-mit
Copy link
Member

mit-mit commented Mar 15, 2017

@munificent any news on this?

@munificent
Copy link
Member

Nope, there won't be any news until analyzer supports it in dart-lang/sdk#27969. dartfmt can't format any syntax that it can't parse. :)

@mit-mit
Copy link
Member

mit-mit commented Mar 27, 2017

Analyzer is done!

@dgrove
Copy link

dgrove commented Mar 28, 2017

Bob - any updates? The last full push to trunk is Wednesday early morning.

@munificent
Copy link
Member

No update yet, I just saw that analyzer support landed (I was out yesterday). I'll take a look as soon as I can.

@bwilkerson, is there a published version of analyzer that supports the new syntax? Are there AST changes?

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

4 participants