Skip to content

go/types: (*Func).Pkg() returns nil for methods from GcImport'ed packages #5815

@dominikh

Description

@dominikh
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. http://play.golang.org/p/u4QW1mXVqS

What is the expected output?
No output

What do you see instead?
Pkg nil for &{{<nil> 0 <nil> Len 0xc210039ae0} <nil>}
Pkg nil for &{{<nil> 0 <nil> Read 0xc210039b10} <nil>}
Pkg nil for &{{<nil> 0 <nil> ReadAt 0xc210039b40} <nil>}
[...]

Please provide any additional information below.
This only happens when going through GcImport. When manually parsing files and using
Context.Check(), Pkg() returns correct values. It also only happens for methods, not for
functions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions