Skip to content

Problem with multiple schemas #31

@3reality-wangzhijie

Description

@3reality-wangzhijie

https://github.com/3reality-wangzhijie/commsdsl-min-demo-for-bug

commsdsl2comms -s --warn-as-err -o out/gen ./prot2.xml ./prot1.xml prot2.1.xml

prot2 and prot1 define two separate schemas. prot2.1.xml references the global fields defined in prot1.
When the input files are provided in the above order, the generated read method of variant U contains an issue:

template <typename TIter>
comms::ErrorStatus read(TIter& iter, std::size_t len)
{
    reset();
    using CommonKeyField=
        comms::field::IntValue<
            ::field::FieldBase<>,
            std::uint8_t,
            comms::option::def::FailOnInvalid<>,
            comms::option::def::FixedValue
        >;
....

The main namespace in its KEY_FIELD_TYPE is missing. I attempted to debug this issue, but the codebase is quite complex and I haven't been able to trace through it for the time being.
Changing the input order generates the correct code:

commsdsl2comms -s --warn-as-err -o out/gen  ./prot1.xml ./prot2.xml prot2.1.xml

However, this causes prot2 to become the main schema, while my intended behavior is for prot1 to be the main schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions