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

Add validation logic to args passed to call methods and refactored BMethodType #43875

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ravinperera00
Copy link
Contributor

@ravinperera00 ravinperera00 commented Mar 5, 2025

Purpose

Task

A caller was able to call a method/function using callMethod() or callFunction() using an arbitrary number of arguments. Validation was added to check whether at least the mandatory number of args are passed.

Fix

BMethodType class was returning null as the rest type when a rest type was present. This issue was fixed to return the expected rest type.

Fixes #43785 #43874

Approach

Task

Analyse the mandatory number of arguments needed to call a particular method and throw an error if that number is not met.

Fix

BMethodType was using the wrong parent constructor. Updated the class to use appropriate parent constructor.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@ravinperera00 ravinperera00 force-pushed the issue_43785 branch 2 times, most recently from c635158 to 8cbf598 Compare March 5, 2025 14:53
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.

[Task]: Improve callMethod() and callFunction() to validate arguments
1 participant