Skip to content

Conversation

@bigpandamx
Copy link

Fixes #602

  • Add automatic downcasting from numeric types to Int for register id parameter in executeFromSelfReg() and executeFromSelfRegWithDefault() functions
  • This mirrors the existing downcast behavior for getVar and executeFromVar
  • Users can now write executeFromSelfRegT or executeFromSelfRegT without manual .toByte casting

Changes:

  • SigmaTyper.scala: Added downcast logic for ExecuteFromSelfRegFunc and ExecuteFromSelfRegWithDefaultFunc in adaptedTypedArgs pattern matching
  • SigmaTyperTest.scala: Added comprehensive test cases verifying downcast functionality with Int and Long literals

All tests passing (58 tests in SigmaTyperTest suite)

Fixes ergoplatform#602

- Add automatic downcasting from numeric types to Int for register id parameter
  in executeFromSelfReg() and executeFromSelfRegWithDefault() functions
- This mirrors the existing downcast behavior for getVar and executeFromVar
- Users can now write executeFromSelfReg[T](4) or executeFromSelfReg[T](4L)
  without manual .toByte casting

Changes:
- SigmaTyper.scala: Added downcast logic for ExecuteFromSelfRegFunc and
  ExecuteFromSelfRegWithDefaultFunc in adaptedTypedArgs pattern matching
- SigmaTyperTest.scala: Added comprehensive test cases verifying downcast
  functionality with Int and Long literals

All tests passing (58 tests in SigmaTyperTest suite)
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.

add DownCast for register id in executeFromSelfReg()

1 participant