From a30b76178800fad0bbf8c2ffa6da9d58c5980479 Mon Sep 17 00:00:00 2001 From: Cedric <14017092+douyixuan@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:22:59 +0800 Subject: [PATCH] use any as mangling for struct and interface --- compiler/compiler/types/interface.go | 2 +- compiler/compiler/types/type.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/compiler/types/interface.go b/compiler/compiler/types/interface.go index 7d47700..dc574de 100644 --- a/compiler/compiler/types/interface.go +++ b/compiler/compiler/types/interface.go @@ -16,7 +16,7 @@ type Interface struct { } func (i Interface) Name() string { - return fmt.Sprintf("interface(%s)", i.SourceName) + return fmt.Sprintf("Any") } // SortedRequiredMethods returns a sorted slice of all method names diff --git a/compiler/compiler/types/type.go b/compiler/compiler/types/type.go index ba7ae3a..f25864d 100644 --- a/compiler/compiler/types/type.go +++ b/compiler/compiler/types/type.go @@ -75,7 +75,7 @@ func (s Struct) LLVM() types.Type { } func (s Struct) Name() string { - return fmt.Sprintf("struct(%s)", s.SourceName) + return fmt.Sprintf("Any") } func (s Struct) Zero(block *ir.Block, alloca llvmValue.Value) {