-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
LanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageLanguageChangeReviewDiscussed by language change review committeeDiscussed by language change review committeeProposal
Milestone
Description
Consider this program:
package main
import (
"fmt"
)
type Foo chan string
func main() {
c := make(Foo, 1)
c <- "gotcha"
fmt.Println(<-c)
}
All is well. Now try to declare a direction for a Foo:
package main
type Foo chan string
func main() {
var x <-Foo
}
// or
func x(c <-Foo) { }
This doesn't parse, but it's reasonable to expect it would and maybe, perhaps with parenthesization, easy to define without ambiguity. (A directional Foo with element type Foo could be tricky.)
Reported on twitter.
deanveloper and Dr-Terriblegbbr and pierrre
Metadata
Metadata
Assignees
Labels
LanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageLanguageChangeReviewDiscussed by language change review committeeDiscussed by language change review committeeProposal