golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.88k stars 17.52k forks source link

gccgo: method invocations do not auto-dereference pointer types #8583

Closed griesemer closed 9 years ago

griesemer commented 10 years ago
$ cat x.go
package main
import "os"
func main() { f(&os.Stdin) }
func f(x **os.File) { x.Close() }

$ gccgo x.go
$

gccgo compiles this program without error. However, Close is not in the method set of
**os.File.

$ gotype x.go
x.go:4:23: invalid operation: x (variable of type **os.File) has no field or method Close

This is the gccgo issue for the corresponding gc issue #6366.
ianlancetaylor commented 10 years ago

Comment 1:

Owner changed to @paranoiacblack.

ianlancetaylor commented 10 years ago

Comment 2:

Fixed on tip by https://golang.org/cl/137730043 .

Status changed to Fixed.