Bug Report: BigInt vs int type mismatches with Dart 3.8
Package: libsql_dart
Version: 0.8.0
Dart SDK: 3.8.1
Flutter: Stable (Linux, Chrome target)
When running a Flutter app that depends on libsql_dart, the build fails with type errors related to int vs BigInt. It seems that flutter_rust_bridge now maps PlatformInt64 to BigInt, but parts of the generated code in libsql_dart still expect int.
This leads to mismatched constructor signatures and invalid assignments.
Error Log (excerpt)
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/params.dart:38:7: Error: The constructor function type 'LibsqlValue_Integer
Function(int)' isn't a subtype of 'LibsqlValue Function(BigInt)'.
- 'LibsqlValue_Integer' is from 'package:libsql_dart/src/rust/utils/params.dart'
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/params.dart').
- 'LibsqlValue' is from 'package:libsql_dart/src/rust/utils/params.dart'
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/params.dart').
- 'BigInt' is from 'dart:core'.
) = LibsqlValue_Integer;
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/return_value.dart:17:7: Error: The constructor function type
'LibsqlReturnValue_Integer Function(int)' isn't a subtype of 'LibsqlReturnValue Function(BigInt)'.
- 'LibsqlReturnValue_Integer' is from 'package:libsql_dart/src/rust/utils/return_value.dart'
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/return_value.dart').
- 'LibsqlReturnValue' is from 'package:libsql_dart/src/rust/utils/return_value.dart'
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/return_value.dart').
- 'BigInt' is from 'dart:core'.
) = LibsqlReturnValue_Integer;
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/helpers.dart:7:32: Error: The argument type 'int' can't be assigned to the parameter type
'BigInt'.
- 'BigInt' is from 'dart:core'.
return LibsqlValue.integer(value);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1194:11: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
- 'BigInt' is from 'dart:core'.
dco_decode_i_64(raw[1]),
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1228:11: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
- 'BigInt' is from 'dart:core'.
dco_decode_i_64(raw[1]),
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1714:42: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
- 'BigInt' is from 'dart:core'.
return LibsqlReturnValue_Integer(var_field0);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1747:36: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
- 'BigInt' is from 'dart:core'.
return LibsqlValue_Integer(var_field0);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:2292:25: Error: The argument type 'int' can't be assigned to the
parameter type 'BigInt'.
- 'BigInt' is from 'dart:core'.
sse_encode_i_64(field0, serializer);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:2320:25: Error: The argument type 'int' can't be assigned to the
parameter type 'BigInt'.
- 'BigInt' is from 'dart:core'.
sse_encode_i_64(field0, serializer);
^
Waiting for connection from debug service on Chrome... 26.0s
Failed to compile application.
Bug Report: BigInt vs int type mismatches with Dart 3.8
Package: libsql_dart
Version: 0.8.0
Dart SDK: 3.8.1
Flutter: Stable (Linux, Chrome target)
When running a Flutter app that depends on libsql_dart, the build fails with type errors related to int vs BigInt. It seems that flutter_rust_bridge now maps PlatformInt64 to BigInt, but parts of the generated code in libsql_dart still expect int.
This leads to mismatched constructor signatures and invalid assignments.
Error Log (excerpt)
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/params.dart:38:7: Error: The constructor function type 'LibsqlValue_Integer
Function(int)' isn't a subtype of 'LibsqlValue Function(BigInt)'.
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/params.dart').
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/params.dart').
) = LibsqlValue_Integer;
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/return_value.dart:17:7: Error: The constructor function type
'LibsqlReturnValue_Integer Function(int)' isn't a subtype of 'LibsqlReturnValue Function(BigInt)'.
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/return_value.dart').
('../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/utils/return_value.dart').
) = LibsqlReturnValue_Integer;
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/helpers.dart:7:32: Error: The argument type 'int' can't be assigned to the parameter type
'BigInt'.
return LibsqlValue.integer(value);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1194:11: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
dco_decode_i_64(raw[1]),
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1228:11: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
dco_decode_i_64(raw[1]),
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1714:42: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
return LibsqlReturnValue_Integer(var_field0);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:1747:36: Error: The argument type 'BigInt' can't be assigned to the
parameter type 'int'.
return LibsqlValue_Integer(var_field0);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:2292:25: Error: The argument type 'int' can't be assigned to the
parameter type 'BigInt'.
sse_encode_i_64(field0, serializer);
^
../../.pub-cache/hosted/pub.dev/libsql_dart-0.8.0/lib/src/rust/frb_generated.dart:2320:25: Error: The argument type 'int' can't be assigned to the
parameter type 'BigInt'.
sse_encode_i_64(field0, serializer);
^
Waiting for connection from debug service on Chrome... 26.0s
Failed to compile application.