Skip to content

create_vector generates the wrong type #2

@MarkSwanson

Description

@MarkSwanson

create_vector() returns a type that can not be used: Offset<Vector<Offsettest::new_request_v2::Pair>>

I can't use it because when I use the generated add_*() method I get:

 //expected `Offset<Vector<Offset<test::new_request_v2::Pair>, &new_request_v2::Pair>>`,
 //found `Offset<Vector<Offset<test::new_request_v2::Pair>>>`

So Vector<> needs to be constructed with T, I. create_vector() needs a different return type?

This is the generated add_*() fn:

pub fn add_x(&mut self, x: fb::Offsetfb::Vector<fb::Offset<Pair, &Pair>>)

I tried to create a new create_vector() but it required lifetimes, and these lifetimes trickled down into problems with Indirect impls etc. so I don't think that's what we want.

Suggestions?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions