google / google/closure-compiler

Allow inline return types between parameters and code block

Open
#1,306 4 comments 0 reactions 0 assignees View on GitHub
enhancement P3
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

```
class Foo {
bar(/** string */ arg) /** number */ { return arg.length + 1; }
get baz() /** string */ { return 'xyz'; }
}
```

This would be a reasonable way to write return types, and mirrors typescript syntax pretty well (as well as other languages, like Go), so it shouldn't be too surprising.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.