-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
sc/shared/src/test/scala/sigmastate/TestingInterpreterSpecification.scala
Show resolved
Hide resolved
@aslesarenko comments addressed , please make another pass |
There was a problem hiding this 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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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