-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version)?
go version go1.11.3 linux/amd64
Does this issue reproduce with the latest release?
yes
What did you do?
package main
import "reflect"
var _ = reflect.ValueOf
func main() {
type C chan int
type C1 chan<- int
type C2 <-chan int
var c C
_ = chan<- int(c) // ok
_ = (<-chan int)(c) // ok
//_ = C1(c) // error:
//_ = C2(c) // error:
var c1a chan<- int
var c2a <-chan int
var c1b C1
var c2b C2
var tc1a = reflect.TypeOf(c1a)
var tc2a = reflect.TypeOf(c2a)
var tc1b = reflect.TypeOf(c1b)
var tc2b = reflect.TypeOf(c2b)
var t = reflect.TypeOf(c)
println(t.ConvertibleTo(tc1a)) // true
println(t.ConvertibleTo(tc2a)) // true
println(t.ConvertibleTo(tc1b)) // true, but the above corresponding line compiles error
println(t.ConvertibleTo(tc2b)) // true, but the above corresponding line compiles error
}Another bug is mentioned a below comment: #29469 (comment)
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.