Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] Fix for downcasting BigInt to Long fails #1007

Merged
merged 4 commits into from
Jul 24, 2024
Merged

[6.0] Fix for downcasting BigInt to Long fails #1007

merged 4 commits into from
Jul 24, 2024

Conversation

kushti
Copy link
Member

@kushti kushti commented Jun 10, 2024

Close #877

It has test from the issue as well similar ones for all the Numeric types.

Also, Downcast from BigInt to BigInt and Upcast from BigInt to BigInt are fixed now

@kushti kushti changed the base branch from develop to v6.0.0 June 10, 2024 19:16
@kushti kushti added this to the v6.0 milestone Jun 10, 2024
@kushti kushti requested a review from aslesarenko June 11, 2024 13:17
@kushti
Copy link
Member Author

kushti commented Jul 24, 2024

@aslesarenko comments addressed , please make another pass

Copy link
Member

@aslesarenko aslesarenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please see the additional comment.

// Fixed in 6.0
assertExceptionThrown(
SBigInt.upcast(CBigInt(new BigInteger("0", 16)).asInstanceOf[AnyVal]),
_.getMessage.contains("Cannot upcast value")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good enough, but FYI there is also method exceptionLike[ConcreteExectionType]("Cannot upcast value") which tests both exception type and the contents of the message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check is corresponding to previously written code, so such refactoring is a subject of a dedicated issue & PR I suppose

@kushti kushti merged commit 271ec30 into v6.0.0 Jul 24, 2024
4 checks passed
@kushti kushti deleted the i877 branch July 24, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants