interp: handle alias of an alias

When dealing with an alias of an alias, the actual underlying type of the source alias should be used.
This commit is contained in:
Nicholas Wiersma
2021-09-27 10:08:11 +02:00
committed by GitHub
parent 98c2dcd3e5
commit 84424b52bc
3 changed files with 31 additions and 1 deletions

27
_test/alias4.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"fmt"
"net/http"
)
type A http.Header
func (a A) Test1() {
fmt.Println("test1")
}
type B A
func (b B) Test2() {
fmt.Println("test2")
}
func main() {
b := B{}
b.Test2()
}
// Output:
// test2