Use `BigInt` for Dart2 compatibility

Issue #2 resolved
Pascal Welsch created an issue

The _factCache contains negative values. This results in crashes. It overflows when running on Dart2 because int was changed to int64. In dart1 it was unlimited.

Switch to BigInt internally to fix that issue.

dnFKc2DhNC.png

Comments (4)

  1. Richard Ambler repo owner

    Hi Pascal,

    Thanks for your interest in this library and for catching this.

    It looks like the library will need a bit of a rewrite for Dart 2. Originally the parent class extended ListBase, which made things very intuitive. Unfortunately, BigInt objects cannot be used to index lists, so the overall design might need a bit of rethinking...

    The underlying functionality shouldn't be too difficult to update though. I'll take a closer look this weekend.

    Thanks again!

  2. Richard Ambler repo owner

    Although I want to do a few more tests and I'll wait for a stable Dart 2 to be released before I upload this library to pub, I think this issue is resolved. To use trotter in Dart 2, include the following in your dependencies:

    trotter:
      git: https://ram6ler@bitbucket.org/ram6ler/dart_trotter.git
    
  3. Log in to comment