Skip to content
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

x/website: the EBNF def of FunctionType.Result is wrong #53746

Closed
fumeboy opened this issue Jul 8, 2022 · 3 comments
Closed

x/website: the EBNF def of FunctionType.Result is wrong #53746

fumeboy opened this issue Jul 8, 2022 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. website
Milestone

Comments

@fumeboy
Copy link

fumeboy commented Jul 8, 2022

What is the URL of the page with the issue?

https://go.dev/ref/spec#Function_types

the definition in doc is

FunctionType = "func" Signature .
Signature = Parameters [ Result ] .
Result = Parameters | Type .
Parameters = "(" [ ParameterList [ "," ] ] ")" .
ParameterList = ParameterDecl { "," ParameterDecl } .
ParameterDecl = [ IdentifierList ] [ "..." ] Type .

the mistack is

the Result shouldnt be produce by = Parameters. the Parameters support (... T) but you couldnt write func signature like func () (...T)

@gopherbot gopherbot added this to the Unreleased milestone Jul 8, 2022
@fumeboy
Copy link
Author

fumeboy commented Jul 8, 2022

image

and the complier tell me ...T should be place as final param, not tell me ...T shouldnt be place at Result

@heschi
Copy link
Contributor

heschi commented Jul 8, 2022

cc @ianlancetaylor @griesemer

@heschi heschi added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 8, 2022
@ianlancetaylor
Copy link
Contributor

There are many cases where the spec's EBNF syntax accepts code that the text then reports as invalid.

@ianlancetaylor ianlancetaylor closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2022
@golang golang locked and limited conversation to collaborators Jul 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. website
Projects
None yet
Development

No branches or pull requests

4 participants