Closed
Description
Describe the bug
The code below has a compilation error on the call to sendPing
within the on Initialize
.
agent PingAgent {
uses Logging, DefaultContextInteractions
var pingIndex = 0
var partner : UUID
on Initialize {
sendPing()
}
on AgentSpawned [partner === null
&& typeof(PongAgent).name == occurrence.agentType] {
partner = occurrence.source.UUID
partner.sendPing
}
on Pong {
occurrence.source.UUID.sendPing
}
def sendPing(counterpart : UUID = null) {
var idx = this.pingIndex
this.pingIndex++
info("Send ping #" + idx)
if (counterpart === null) {
new Ping(idx).emit
} else {
assert counterpart !== null
new Ping(idx).emit[it.UUID == counterpart]
}
}
}
The error is : "The method sendPing() from the type PingAgent refers to the missing type Object"/
System configuration:
-- SARL version: 0.8.1
-- SARL compiler:
-
- Eclipse compiler without Maven
-
- Eclipse compiler with Maven
-
- Maven compiler on the command line
-
- sarlc compiler
-- Java JDK version (with the manufacturer name):
-- Operating System:
- sarlc compiler
-
- Linux 64bits
-
- Linux 32bits
-
- Windows 64bits
-
- Windows 32bits
-
- MacOS 64bits