-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/packages
#5355Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityfound in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Pigeon ignores default values for member variables and generated classes for all backends (Flutter, Android, iOS) doesn't have those default values.
Steps to reproduce
Pigeon class
class Test {
var intResult = 20;
var boolResult = true;
}Generated class
class Test {
int intResult; // nothing here
int boolResult; // nothing here
Object encode() {
final Map<Object, Object> pigeonMap = <Object, Object>{};
pigeonMap['intResult'] = intResult;
pigeonMap['boolResult'] = boolResult;
return pigeonMap;
}
static CreateConnectorMessage decode(Object message) {
final Map<Object, Object> pigeonMap = message as Map<Object, Object>;
return CreateConnectorMessage()
..intResult = pigeonMap['intResult'] as int
..boolResult = pigeonMap['boolResult'] as bool;
}
}Actual result
- members in generated classes doesn't have default values
Expected result
- members in generated classes must be initialised with default values when specified
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityfound in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team