-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
Before filing a bug, please check whether it has been fixed since the latest release: run "hg pull -u" and retry what you did to reproduce the problem. Thanks. What steps will reproduce the problem? 1. '6g funcequal.go' (attached) 2. 3. What is the expected output? Compiles without error What do you see instead? funcequal.go:16: invalid operation: doCompare == foo (type func(v1 int, v2 int) int == CompareFunc) What is your $GOOS? $GOARCH? linux, amd64 Which revision are you using? (hg identify) d558ddfffe1d+ tip Please provide any additional information below. The function pointer for doCompare is assigned to a variable which silently converts it to the compatible type, CompareFunc. That variable is then compared with the original pointer, which seems like it should be possible, given the previous assignment. The compiler errors out because the two function pointers are of different types.
Attachments:
- funcequal.go (319 bytes)