Skip to content

Objects with points_to relationships not usable in views #13

@boris-kolpackov

Description

@boris-kolpackov

Reproducer:

#pragma db object
struct A
{
#pragma db id
    int id;
    int fieldA;
};

#pragma db object
struct B
{
#pragma db id
    int id;
    int fieldB;

#if 1
#pragma db points_to(A)
    int refA;
#else
    A* refA;
#endif
};

#pragma db view object(A) object(B)
struct View
{
    int fieldA;
    int fieldB;
};

Trying to compile this with the ODB compiler produces the following error:

test.h:22:27: error: unable to find an object relationship involving object 'B' and any of the previously associated objects

The same compiles ok after switching to using an actual pointer for B::refA.

Possibly related to #9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions