TelluIoT / ThingML

The ThingML modelling language

Home Page:https://github.com/TelluIoT/ThingML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid generated code when a message parameter and the instance share the same name

fungiboletus opened this issue · comments

ThingML model to reproduce the problem

thing fragment StatusMsg {
	message stalled(status: Boolean)
}
thing fragment StatusProvidedPort includes StatusMsg {
	provided port statusInput {
		receives stalled
	}
}
thing Status includes StatusProvidedPort {
    statechart init default {
        state default {
            internal event e.statusInput?stalled guard e.status == true action print "Stalled"
        }
    }
}
configuration Whatever {
    ...
    instance status:Status
    ...
    connector otherThing.statusInput => status.statusInput
    ...
}

Generated code

controller.bus.on('statusInput?stalled', (status) => status.receivestalledOnstatusInput(status));

Problem

status is not the status instance but the status boolean parameter. In other words, a message parameter may override the instance reference.

Are you fixing it?