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

Syntax Inconsistency? #16

Closed
gbasso opened this issue Mar 11, 2014 · 1 comment
Closed

Syntax Inconsistency? #16

gbasso opened this issue Mar 11, 2014 · 1 comment
Milestone

Comments

@gbasso
Copy link

gbasso commented Mar 11, 2014

When trying to create an agent with the following code, I obtain a compilation error.

event Titi {
}

agent HelloAgent {
    uses Lifecycle, Schedules, DefaultContextInteractions

    on Initialize {
        System.out.println("Hello World!") emit(new Titi)
    }

    on Titi {
        spawn(HelloAgent, #[])
        HelloAgent.spawn(#[])
        spawn(HelloAgent)
        HelloAgent.spawn()
    }

    /* Print "Goodbye World" before dying */
    on Destroy {
        System.out.println("Goodbye World!")
    }
}

The two first lines with the "spawn" statements are correctly compiled.
The third line with the "spawn" statement gives the error:

Multiple markers at this line
- Type mismatch: cannot convert implicit first argument from
   HelloAgent to Class<? extends Agent>
- Type mismatch: cannot convert from Class<HelloAgent> to Object[]

The fourth line with the "spawn" statement gives the error:

Invalid number of arguments. The method spawn(Class<? extends
   Agent>, Object[]) is not applicable for the arguments (Class<HelloAgent>)
@gallandarakhneorg
Copy link
Member

This issue is related to the issues #1 and #2.

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

No branches or pull requests

2 participants