diff options
author | Piotr Fusik <piotr@fusion-lang.org> | 2024-02-05 06:33:39 +0100 |
---|---|---|
committer | Piotr Fusik <piotr@fusion-lang.org> | 2024-02-05 06:33:39 +0100 |
commit | 65eb83dd509d03d00ae96d334c9b49436499221a (patch) | |
tree | fba892fb493564d5e2b04c7f5a8c74064dfd01c7 | |
parent | 36289971f966f3e8dd1d428046c45074a7ba332c (diff) |
[fut] Fix Java fut.
-rw-r--r-- | GenC.fu | 3 | ||||
-rw-r--r-- | libfut.cpp | 4 | ||||
-rw-r--r-- | libfut.cs | 3 | ||||
-rw-r--r-- | libfut.js | 4 |
4 files changed, 12 insertions, 2 deletions
@@ -860,6 +860,9 @@ public class GenC : GenCCpp void WriteDictionaryDestroy!(FuType? type) { switch (type) { + case null: // for Java fut + Write("NULL"); + break; case FuStringStorageType: case FuArrayStorageType: Write("free"); @@ -9747,7 +9747,9 @@ bool GenC::hasDictionaryDestroy(const FuType * type) void GenC::writeDictionaryDestroy(const FuType * type) { - if (dynamic_cast<const FuStringStorageType *>(type) || dynamic_cast<const FuArrayStorageType *>(type)) + if (type == nullptr) + write("NULL"); + else if (dynamic_cast<const FuStringStorageType *>(type) || dynamic_cast<const FuArrayStorageType *>(type)) write("free"); else if (const FuOwningType *owning = dynamic_cast<const FuOwningType *>(type)) do { @@ -10041,6 +10041,9 @@ namespace Fusion void WriteDictionaryDestroy(FuType type) { switch (type) { + case null: + Write("NULL"); + break; case FuStringStorageType: case FuArrayStorageType: Write("free"); @@ -10393,7 +10393,9 @@ export class GenC extends GenCCpp #writeDictionaryDestroy(type) { fuswitch0: { - if (type instanceof FuStringStorageType || type instanceof FuArrayStorageType) + if (type == null) + this.write("NULL"); + else if (type instanceof FuStringStorageType || type instanceof FuArrayStorageType) this.write("free"); else if (type instanceof FuOwningType) { const owning = type; |