1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00
ton/crypto
tolk-vm f3e620f48c
[Tolk] Nullable types T? and null safety
This commit introduces nullable types `T?` that are
distinct from non-nullable `T`.
Example: `int?` (int or null) and `int` are different now.
Previously, `null` could be assigned to any primitive type.
Now, it can be assigned only to `T?`.

A non-null assertion operator `!` was also introduced,
similar to `!` in TypeScript and `!!` in Kotlin.

If `int?` still occupies 1 stack slot, `(int,int)?` and
other nullable tensors occupy N+1 slots, the last for
"null precedence". `v == null` actually compares that slot.
Assigning `(int,int)` to `(int,int)?` implicitly creates
a null presence slot. Assigning `null` to `(int,int)?` widens
this null value to 3 slots. This is called "type transitioning".

All stdlib functions prototypes have been updated to reflect
whether they return/accept a nullable or a strict value.

This commit also contains refactoring from `const FunctionData*`
to `FunctionPtr` and similar.
2025-02-28 16:41:41 +03:00
..
block Add forgotten highload-v2 to unlock (#1511) 2025-02-03 11:16:44 +03:00
common Export all keys command in validator-engine-console (#1412) 2024-12-03 17:19:12 +03:00
ellcurve TVM instructions: SECP256K1_XONLY_PUBKEY_TWEAK_ADD, SETCONTCTRMANY(X) (#1404) 2024-11-26 16:23:17 +03:00
fift Fix loading library cell in contract code 2024-12-18 12:57:21 +03:00
func [FunC] Make Expr::VarApply always impure (#1381) 2024-11-14 18:32:04 +03:00
funcfiftlib [Tolk] Rewrite lexer, spaces are not mandatory anymore 2024-11-02 01:33:08 +04:00
keccak TVM Upgrade (#686) 2023-05-24 21:14:13 +03:00
openssl celldb in-memory mode, stats for actors, perf counters, minor fix in rldp2 (#1164) 2024-09-23 17:34:37 +03:00
parser Various changes in TVM, github builds and tests (#793) 2023-11-03 14:43:34 +03:00
smartcont [Tolk] Nullable types T? and null safety 2025-02-28 16:41:41 +03:00
smc-envelope Merge branch 'testnet' into tvm-v9 2025-01-17 12:32:09 +03:00
test TVM instructions: SECP256K1_XONLY_PUBKEY_TWEAK_ADD, SETCONTCTRMANY(X) (#1404) 2024-11-26 16:23:17 +03:00
tl Fix printing TLB NatWidth (#1501) 2025-01-27 12:55:00 +03:00
util Merge branch 'SpyCheese-mintless-util' into testnet 2024-09-13 20:44:47 +03:00
vm Fix advance_ext (#746) 2025-01-27 12:22:00 +03:00
CMakeLists.txt TVM instructions: SECP256K1_XONLY_PUBKEY_TWEAK_ADD, SETCONTCTRMANY(X) (#1404) 2024-11-26 16:23:17 +03:00
Ed25519.cpp bugfixes + decreased archive slice size 2020-04-08 23:49:28 +04:00
Ed25519.h emergency update 2020-03-24 03:32:16 +04:00