compiler: simplify interface lowering

This commit simplifies the IR a little bit: instead of calling
pseudo-functions runtime.interfaceImplements and
runtime.interfaceMethod, real declared functions are being called that
are then defined in the interface lowering pass. This should simplify
the interaction between various transformation passes. It also reduces
the number of lines of code, which is generally a good thing.
This commit is contained in:
Ayke van Laethem
2021-10-24 14:29:40 +02:00
committed by Ron Evans
parent 90076f9401
commit a4afc3b4b0
14 changed files with 355 additions and 397 deletions
+9
View File
@@ -49,6 +49,15 @@ func isStringer(itf interface{}) bool {
return ok
}
type fooInterface interface {
String() string
foo(int) byte
}
func callFooMethod(itf fooInterface) uint8 {
return itf.foo(3)
}
func callErrorMethod(itf error) string {
return itf.Error()
}