Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit bind of vector and multivector fails #17

Closed
boxdot opened this issue Feb 4, 2018 · 2 comments
Closed

Implicit bind of vector and multivector fails #17

boxdot opened this issue Feb 4, 2018 · 2 comments
Assignees

Comments

@boxdot
Copy link
Collaborator

boxdot commented Feb 4, 2018

When trying to bind implicitly a vector and a multivector the generator fails. Example:

@bound_implicitly( characters: vertices, character_data )
archive Graph {
    vertices : vector< Character >;
    character_data: multivector< 32, Nickname, Description >;
}

Error:

12:41:29 - CRITICAL - app:67 - Error reading schema: Referring to incorrect type. Expected <class 'generator.tree.nodes.resources.vector.Vector'>, actual <class 'generator.tree.nodes.resources.multivector.Multivector'>

Is this expected? As far as I understand, it should be possible to bind both. In my example, I am referencing the elements of vertices and character_data with the same index.

A small sidenote: probably, the error should also refer to the line in flatdata's source, instead of the line in the source code of the generator.

@VeaaC
Copy link
Collaborator

VeaaC commented Feb 4, 2018

It's a limitation of the generator (see bound_resource.py):

    def _create_references(self):
        return [VectorReference(name=r) for r in self._resources]

Should most likely be fixed to be a generic ResourceReference, or a reference to things that are index-addressable (everything except RAW I think)

@imagovrn
Copy link
Contributor

imagovrn commented Feb 6, 2018

Please see the comment in the PR #18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants