In aliased type declarations, when the target type was imported from an external package rather than declared locally, the aliased type was overwritten by target, loosing ability to lookup methods on the aliased type. Aliasing on imported types is now properly detected and handled. Fixes #971.
16 lines
182 B
Go
16 lines
182 B
Go
package main
|
|
|
|
import "time"
|
|
|
|
type TimeValue time.Time
|
|
|
|
func (v *TimeValue) decode() { println("in decode") }
|
|
|
|
func main() {
|
|
var tv TimeValue
|
|
tv.decode()
|
|
}
|
|
|
|
// Output:
|
|
// in decode
|