Marc Vertes
236a0effaf
interp: improve the behaviour of interface{} function parameters
...
We finally address a long standing limitation of the interpreter:
the capacity to generate the correct interface wrapper for an
anonymous interface{} function parameter of a binary function.
It allows for example fmt.Printf to invoke the String method
of an object defined within the interpreter, or json.Marshal
to invoke a textMarshaler method if it exists and if there is
no Marshaler method already defined for the passed interpreter
object.
To achieve that, we add a new mapType part of the "Used" symbols
to describe what not empty interfaces are expected and in which
priority order. This information can not be guessed and is found
in the related package documentation, then captured in stdlib/maptypes.go.
Then, at compile time and/or during execution, a lookup on mapTypes
is performed to allow the correct wrapper to be generated.
This change adds a new MapType type to the stdlib package.
Fixes #435 .
2022-06-14 10:18:08 +02:00
..
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-11-26 11:42:07 +01:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-11-26 12:10:08 +01:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-11-02 15:20:06 +01:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-11-26 12:10:08 +01:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-11-02 15:20:06 +01:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-10-08 15:56:06 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2021-08-17 11:42:07 +02:00
2022-06-14 10:18:08 +02:00
2020-07-08 22:35:04 +02:00
2022-06-14 10:18:08 +02:00