aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/interface.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-03-24 01:21:53 +0100
committerRon Evans <[email protected]>2021-03-28 14:00:37 +0200
commitc5ec95508127678ebbd11df8bdcf30d83766a141 (patch)
tree424bac80d7a9e284a14a5b218c8865b2f41708e0 /compiler/interface.go
parent5d334922d78ed85e1e83341d2d6262755e043b19 (diff)
downloadtinygo-c5ec95508127678ebbd11df8bdcf30d83766a141.tar.gz
tinygo-c5ec95508127678ebbd11df8bdcf30d83766a141.zip
compiler: fix lack of method name in interface matching
This is required for correctly differentiating between interface types.
Diffstat (limited to 'compiler/interface.go')
-rw-r--r--compiler/interface.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/interface.go b/compiler/interface.go
index b4bf4cd0c..ed75b3577 100644
--- a/compiler/interface.go
+++ b/compiler/interface.go
@@ -186,7 +186,7 @@ func getTypeCodeName(t types.Type) string {
case *types.Interface:
methods := make([]string, t.NumMethods())
for i := 0; i < t.NumMethods(); i++ {
- methods[i] = getTypeCodeName(t.Method(i).Type())
+ methods[i] = t.Method(i).Name() + ":" + getTypeCodeName(t.Method(i).Type())
}
return "interface:" + "{" + strings.Join(methods, ",") + "}"
case *types.Map: