Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pigeon] C++ generator makes uncompilable code for returning a list #105057

@stuartmorgan-g

Description

@stuartmorgan-g

I defined an API of the form:

List<String?> foo(...);

and the resulting C++ code doesn't compile for me. It gets translated to

virtual ErrorOr<std::unique_ptr<flutter::EncodableList>> Foo(...);

which doesn't work because ErrorOr<T> has a const T& rhs constructor that calls T(rhs), which is a deleted copy constructor for std::unique_ptr.

I'm confused about how this new variant of ErrorOr is intended to work now that I'm looking at it in actual use. v is a variant whose types include a T and a std::unique_ptr<T>, which in this case would be a nested double unique_ptr which seems unlikely to be the intent. @azchohfi what was the intended behavior here?

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions