-
Notifications
You must be signed in to change notification settings - Fork 227
Open
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems
Description
With records, it becomes tempting to rely more on type-inference. Inference is important for records, because it avoids lots of repetition
The problem is, inference for the return value of function is only available with closures:
// Inferred as ({String name, int age}) Function()
final example = () => (name: '', age: 42);If we use a "normal" function, we are forced to specify the return value:
({String name, int age}) example() => (name: '', age: 42);Proposal
It'd be cool to have a mean to define classical functions, but infer the value. One possibility could be:
infer example() => (name: '', age: 42);PiotrRogulski, rrousselGit, rubenferreira97, lishaduck, KlausJokisuo and 5 morejulemand101
Metadata
Metadata
Assignees
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems