Skip to content

Commit

Permalink
fdjslkj
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrinneal committed Aug 8, 2023
1 parent 6f20847 commit 6b671d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/pigeon/lib/cpp_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -979,11 +979,11 @@ class CppSourceGenerator extends StructuredGenerator<CppOptions> {
argName: argName,
encodableArgName: encodableArgName,
);
// final String unwrapEnum =
// isEnum(root, arg.type) && arg.type.isNullable
// ? '.value()'
// : '';
methodArgument.add(argName);
final String unwrapEnum =
isEnum(root, arg.type) && arg.type.isNullable
? ' ? &(*$argName) : nullptr'
: '';
methodArgument.add('$argName$unwrapEnum');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1733,8 +1733,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger,
an_enum_arg = std::make_optional<AnEnum>(
std::get<int>(encodable_an_enum_arg));
}
ErrorOr<std::optional<AnEnum>> output =
api->EchoNullableEnum(an_enum_arg);
ErrorOr<std::optional<AnEnum>> output = api->EchoNullableEnum(
an_enum_arg ? &(*an_enum_arg) : nullptr);
if (output.has_error()) {
reply(WrapError(output.error()));
return;
Expand Down

0 comments on commit 6b671d8

Please sign in to comment.