You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The frb_generated.dart file generates the following error:
lib/src/rust/frb_generated.dart:244:34: Error: The argument type 'List<BigInt>' can't be assigned to the parameter type 'List<int>'.
- 'List' is from 'dart:core'.
- 'BigInt' is from 'dart:core'.
Uint64List.fromList(self.toList()), serializer);
It refers to this part of the frb_generated.dart file:
@protected
void sse_encode_Set_u_64(Set<BigInt> self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_list_prim_u_64_strict(
Uint64List.fromList(self.toList()), serializer);
}
[√] Flutter (Channel stable, 3.27.0, on Microsoft Windows [Version 10.0.19045.5371], locale en-US)
• Flutter version 3.27.0 on channel stable at C:\SDKs\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8495dee1fd (6 weeks ago), 2024-12-10 14:23:39 -0800
• Engine revision 83bacfc525
• Dart version 3.6.0
• DevTools version 2.40.2
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc1)
• Android SDK at C:\Users\Dominic\AppData\Local\Android\sdk
• Platform android-35, build-tools 36.0.0-rc1
• Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32901.215
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2024.2)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
[√] VS Code (version 1.96.2)
• VS Code at C:\Users\Dominic\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.102.0
[√] Connected device (4 available)
• Pixel 7 (mobile) • 2A271FDH200DGG • android-arm64 • Android 15 (API 35)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.5371]
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.265
• Edge (web) • edge • web-javascript • Microsoft Edge 131.0.2903.146
[√] Network resources
• All expected network resources are available.
• No issues found!
The text was updated successfully, but these errors were encountered:
From a cursory glance, it seems likeUint64List inside generalized_typed_data/_io.dart needs to be modified to accept construction from a List<BigInt>? Not sure if larger changes are required though.
Yes, looks like a bug (probably because how u64 is handled especially on the web...), and will be fixed in the next batch. Btw, try type_64bit_int: true to see whether it workarounds.
Yeah, it works with type_64bit_int: true (so long as full_dep is not enabled), though of course a little unideal since it doesn't capture the full range of values for a u64. If full_dep is enabled, though, an error occurs in the frb_generated.io.dart file:
Error:
lib/src/rust/frb_generated.io.dart:131:7: Error: The method 'cst_api_fill_to_wire_CastedPrimitive_u_64' isn't defined for the class 'RustLibApiImplPlatform'.
- 'RustLibApiImplPlatform' is from 'package:frb_int/src/rust/frb_generated.io.dart' ('lib/src/rust/frb_generated.io.dart').
Try correcting the name to the name of an existing method, or defining a method named 'cst_api_fill_to_wire_CastedPrimitive_u_64'.
cst_api_fill_to_wire_CastedPrimitive_u_64(raw[i], ans.ref.ptr[i]);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Code snippet inside frb_generated.io.dart:
@protected
ffi.Pointer<wire_cst_list_CastedPrimitive_u_64>
cst_encode_list_CastedPrimitive_u_64(List<int> raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
final ans = wire.cst_new_list_CastedPrimitive_u_64(raw.length);
for (var i = 0; i < raw.length; ++i) {
cst_api_fill_to_wire_CastedPrimitive_u_64(raw[i], ans.ref.ptr[i]);
}
return ans;
}
Describe the bug
It seems like serializing
HashSet<u64>
yields incorrect Dart code. This is with or without the--full-dep
flag.Steps to reproduce
In a brand new Flutter project (or inside the
dart_minimal
project), add the following:The
frb_generated.dart
file generates the following error:It refers to this part of the
frb_generated.dart
file:Logs
RUST_LOG=debug flutter_rust_bridge_codegen generate
OS
Windows 10
Version of
flutter_rust_bridge_codegen
2.7.0
Flutter info
The text was updated successfully, but these errors were encountered: