ssa: interface equal

This commit is contained in:
visualfc
2024-06-11 10:24:30 +08:00
parent 439a69f413
commit bdf1c275c4
4 changed files with 150 additions and 6 deletions

View File

@@ -166,6 +166,9 @@ func (b *Builder) TypeName(t types.Type) (ret string, pub bool) {
// PathOf returns the package path of the specified package.
func PathOf(pkg *types.Package) string {
if pkg == nil {
return ""
}
if pkg.Name() == "main" {
return "main"
}
@@ -174,6 +177,9 @@ func PathOf(pkg *types.Package) string {
// FullName returns the full name of a package member.
func FullName(pkg *types.Package, name string) string {
if pkg == nil {
return name
}
return PathOf(pkg) + "." + name
}