Skip to content

Call operations with arbitrary number of arguments #6

@igorcadelima

Description

@igorcadelima

Hi, devs!

I've come across an unexpected error when trying to call operations with arbitrary number of arguments (varargs). Suppose I have the following operation:

@OPERATION
addString(String... s) {...}

It simply doesn't work if a Jason agent calls addObj("hello"), addObj("hello", "world"), or addObj(["hi"]). It prints the error:

  • expected 1 parameter(s) - types: class [Ljava.lang.String;
  • actual parameter(s): [Ljava.lang.Object;@3b269972 type: class [Ljava.lang.Object;"),percept_type(obs_prop),source(percept),artifact_name(cobj_1,bob-body),workspace(cobj_1,main,cobj_0)]

Varargs is a really nice feature which is everywhere. Do you consider to give support to such feature?

Cheers,
Igor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions