Marc Vertes
a3b2737b5c
fix: make interpreter methods discoverable by runtime ( #722 )
...
* fix: make interpreter methods discoverable by runtime
When generating an interface wrapper, lookup existing wrappers by method
to get the one with the biggest set of methods implemented by interpreter.
A string method is also added to wrappers, in order to provide a string
representation of the interpreter value rather than the wrapper itself
(at least for %s and %v verbs).
This allows the runtime to pickup an interpreter method automatically
even if the conversion to the interface is not specified in the script. As
in Go spec, it is enough for the type to implement the required methods.
A current limitation is that only single wrappers can be instantiated,
not allowing to compose interfaces.
This limitation can be removed when the Go reflect issue
https://github.com/golang/go/issues/15924 is fixed.
Fixes #435 .
* test: add a simpler test
2020-06-29 14:25:14 +02:00
..
2020-06-29 14:25:14 +02:00
2020-06-22 16:40:03 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2019-09-16 14:06:11 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-16 14:06:11 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2019-09-16 14:06:11 +02:00
2019-09-16 14:06:11 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2019-09-09 09:59:26 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2019-09-09 09:59:26 +02:00
2019-09-27 15:44:05 +02:00
2020-06-18 13:54:04 +02:00
2019-09-09 09:59:26 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-29 14:25:14 +02:00
2020-06-18 13:54:04 +02:00
2020-06-18 13:54:04 +02:00
2020-06-29 14:25:14 +02:00
2020-02-26 15:06:06 +01:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-02-26 15:06:06 +01:00
2020-06-18 13:54:04 +02:00
2020-06-22 12:55:42 +02:00