mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-04-10 13:30:55 +01:00
Update syntax-named-function-type-returns.md
This commit is contained in:
parent
203d3af302
commit
8a92b3a126
1 changed files with 2 additions and 2 deletions
|
@ -69,7 +69,7 @@ local function x(): (return1: number, return2: number)
|
|||
|
||||
This syntax is fully backwards compatible as only type names, generic names, or type packs are allowed in return position.
|
||||
|
||||
Broadly, return names behave identically to parameter names.
|
||||
Return names are documentative - they are not identifiers that are usable in the function body.
|
||||
|
||||
Function type comparisons will ignore the return names, this proposal doesn't change the semantics of the language and how typechecking is performed.
|
||||
|
||||
|
@ -194,4 +194,4 @@ For a community project to implement support, they would need to discover all of
|
|||
|
||||
There is a very real possibility that not implementing *any* standard way of annotating return type names will discourage people from documenting them at all, reducing the quality of documentation in the Luau ecosystem.
|
||||
|
||||
The upshot is that Luau would remain unopinionated and free to ignore comments completely. We punt the problem to the community and all consumers of Luau, who will have to invent their own methods of documenting this info if it is desired.
|
||||
The upshot is that Luau would remain unopinionated and free to ignore comments completely. We punt the problem to the community and all consumers of Luau, who will have to invent their own methods of documenting this info if it is desired.
|
||||
|
|
Loading…
Add table
Reference in a new issue