Skip to content

Bug Report: BigInt vs int type mismatches with Dart 3.8 #15

@Mrhamza01

Description

@Mrhamza01

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions