Commit graph

11 commits

Author SHA1 Message Date
Roman Khimov
6deb77a77a compiler: make interface{}() conversions possible 2022-07-07 15:10:29 +03:00
Evgeniy Stratonikov
0e86073a77 compiler: group small tests in a single file
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-03-04 17:55:33 +03:00
Evgeniy Stratonikov
7160675ac1 compiler/interop: improve conversion to bytes interops
Allow to convert to both `Buffer` and `ByteString`
and explicitly mention VM types. Rename `ToByteArray` to `ToBytes`
to avoid ambiguity.
2021-03-10 13:38:44 +03:00
Evgeniy Stratonikov
d66ce43239 compiler/interop: replace int64 with int 2021-03-04 13:20:43 +03:00
Evgeniy Stratonikov
e5d8c1c985 compiler: allow conversion to types from external packages 2021-02-08 11:02:45 +03:00
Evgenii Stratonikov
2c5ab95b8a compiler: convert to ByteArray for string variables
Convert to ByteArray when converting variable to `string`, because
underlying byte-slice changes should not affect result string.
2020-06-24 18:59:36 +03:00
Evgenii Stratonikov
1d275ceb65 compiler: distinguish between type conversions and function calls
RN every identifier in call expression is considered to be lambda.
But it also can be type expression, so we need to distinguish between
these cases.
2020-06-24 18:46:32 +03:00
Evgenii Stratonikov
904b2136fc compiler: emit CONVERT opcode for type assertions
Emit CONVERT for converting between different types. NeoVM behavior is
different from that of Go (e.g. assertions of `int` and `uint32` are
equivalent).
2020-06-24 18:00:26 +03:00
Evgenii Stratonikov
3a4ed7dfe8 compiler: emit Buffer for byte slices
All byte slices are mutable so buffer is a right stack item.
2020-05-20 17:45:56 +03:00
Evgenii Stratonikov
4b064e18aa emit: converto to Boolean in Bool() 2020-04-28 17:36:58 +03:00
Evgenii Stratonikov
2fd63387c0 compiler: support CONVERT interops
When result is needed to have certain type, we should have ability
to convert it, with the help of CONVERT opcode.
2020-04-28 16:44:06 +03:00