TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
101 stars 32 forks source link

Function is never called warning on fragment #306

Closed fungiboletus closed 3 years ago

fungiboletus commented 3 years ago

I have a thing fragment like this:

thing fragment Stuff {
  function doStuff() do
    print "her"
  end
}

and another thing using it like this :

thing OtherStuff includes Stuff {
  statechart init DoStuff {
    final state DoStuff {
      on entry do
        doStuff()
      end
    }
  }
}

Should we have a warning in doStuff of Stuff since it's a fragment ?

brice-morin commented 3 years ago

I fixed the validation rule so that it checks if it is called by "including" things (i.e. any Thing that include the function directly or not).