question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parameter type inference for anonymous functions in assignments

See original GitHub issue

Here is one possible use case

shared Object bar(Request req, Response res) => "Hello";
shared Object baz(Request req, Response res) => "World ";
// ...
//vs
shared alias Route => Object(Request, Response);
shared Route bar = (req, res) => "Hello";
shared Route baz = (req, res) => "World";
// ...

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fwgreencommented, Apr 18, 2018

@gavinking I cloned it again and this time it works! Thanks!

1reaction
gavinkingcommented, Apr 18, 2018

This is now basically done, on the 6615 branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposal for Parameter Type Inference for immediately invoked ...
I have to target ES3/ES5 and I quite often find myself writing something like this: for (let roleType of this.RoleTypes) { ((roleType) =>...
Read more >
Anonymous Functions - HHVM and Hack Documentation
Type Inference. Unlike named functions, type annotations are optional on anonymous functions. You can still add explicit types if you wish.
Read more >
Lambda expressions and anonymous functions | Microsoft Learn
You use a lambda expression to create an anonymous function. Use the lambda declaration operator => to separate the lambda's parameter list ...
Read more >
Type inference - Kotlin language specification
Kotlin has a concept of type inference for compile-time type information, meaning some type information in the code may be omitted, to be...
Read more >
Functions - TypeScript: Handbook
Of note, only the parameters and the return type make up the function type. Captured variables are not reflected in the type. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found