v0.7.1
Ban different method (return / param) type of same method
From 0.7.1
on, getter and setter methods with the same name must return and accept the same type.
Because we are using property
feature in C# to generate code like this:
// CustomGetterSetter: TemperaturePercent
public double TemperaturePercent
{
get => ((this.temperature / 10) - 40);
set => this.temperature = (ushort)((value == 0) ? 0 : ((value + 40) * 10));
}
If we allow users define method like this, then we are not able to use property
any more.
struct RovSensorCabTempHumidPressData2 {
uint16 temperature[2] {
get temperature_percent(float64): value / 10 - 40;
set temperature_percent(int32): (uint16)(value == 0 ? 0 : (value + 40) * 10);
};
}
Bugfix
- Fix getter & setter format, remove redundant empty line for C# target.
- Fix wrong order in the error info while method name conflicting with field name.
Changelog
- f3ef12b Ban different method type of same method. Fix C# getter setter format. Fix error info