eclipse / mita

mita
Eclipse Public License 2.0
56 stars 20 forks source link

Error executing EValidator #366

Closed justindannguyen closed 5 years ago

justindannguyen commented 5 years ago

Current behavior: Using struct in events function resulted a compilation error ERROR | Error executing EValidator No C code are generated in base folder.

Expected behavior:

Mita compiles successfully and C code are generated

Steps to reproduce:

TBD Related code:

struct RoomClimate {
  var temperature : uint32;
  var humidity : uint32;
  var pressure : uint32;
  var light : uint32;
}
setup mqtt: MQTT {
...
}

fn toJson(rc : RoomClimate) {
    return `{"temperature": ${rc.temperature}, "humidity": ${rc.humidity}, "pressure":${rc.pressure}, "lux": ${rc.light}}`;
}

every 2 seconds {
  varcelcius : uint32 = environment.temperature.read() / 1000;
  var humidity : uint32= environment.humidity.read();
  var pressure : uint32 = environment.pressure.read();
  var light : uint32 = light.intensity.read() / 1000;
  let rcm : RoomClimate = RoomClimate(celcius, humidity, pressure , light );
  var jsonData = toJson(rcm);
  mqtt.telemetry.write(jsonData);
}

Other information:

Workbench 3.6.0, XDK Device 1.1.0, Mita 0.1.0.xx

wegendt-bosch commented 5 years ago

Not reproducable in master. You might want to try renaming the variable light since it clashes with xdk110.light.