mocks.cr icon indicating copy to clipboard operation
mocks.cr copied to clipboard

Compatibility fixes for 0.34.0

Open rwnx opened this issue 4 years ago • 1 comments

  • Time.new -> Time.utc
  • object_id needed to be made public, since the new hash implementation in 0.32 expects it to be available (presumably because of compare_by_identity)?
  • Used BigInt to deal with arithmetic overflow in hash methods - I hope I got the spirit of what's being accomplished here correct - a bitmask'd unique number.
  • Changed multiplications 32*32 to bitwise shifts to make intent clearer.

What I haven't solved yet is the (currently failing) test for overriding a builtin class (.e.g. File) - My current investigations indicate this is because you need to specify the argument and the argument restrictions exactly, otherwise the overload never gets called.

See this example: https://play.crystal-lang.org/#/r/8vtj

rwnx avatar Apr 13 '20 22:04 rwnx

I have a couple of ideas for solving the signatures problem, but they involve specifying the types on the arguments, which might be a breaking change from here on out.

rwnx avatar Apr 16 '20 00:04 rwnx