gocode icon indicating copy to clipboard operation
gocode copied to clipboard

Gocode misunderstands method expressions

Open nsf opened this issue 14 years ago • 2 comments

http://golang.org/doc/go_spec.html#Method_expressions

Example: package main

import (
    "fmt"
)

type Int int

func (i Int) String() string {
    return fmt.Sprint(int(i))
}

func main() {
    f := Int.String
    // here gocode thinks that 'f' is: 'func() string'
    // but in reality it is: 'func(i Int) string'
}

Even though method expressions are rarely used, I need to fix that too.

nsf avatar Dec 27 '10 03:12 nsf

It seems this issue is solved already?

mattn avatar Apr 25 '13 01:04 mattn

No. No one worked on it. In fact given current gocode architecture it's a very hard problem to solve. At least that's how I remember it.

nsf avatar Apr 25 '13 07:04 nsf