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

Different values returned using getPointerPath vs getBase #211

Open
brollb opened this issue May 19, 2020 · 1 comment
Open

Different values returned using getPointerPath vs getBase #211

brollb opened this issue May 19, 2020 · 1 comment

Comments

@brollb
Copy link
Collaborator

brollb commented May 19, 2020

When getting the base of a node implicitly created (structural inheritance), getPointerPath gets the original meta type (not the path of the corresponding node contained in the parent's base) whereas core.getPath(core.getBase(node)) returns the expected path.

@kecso
Copy link
Member

kecso commented Jan 6, 2021

I know that it sounds odd, but that is how these functions are expected to work.
When figuring out inheritance, you should not use getPointerPath (and in general do not use it with 'base' even though it is technically a pointer...).
What happens in the first case is that the pointer itself is inherited and therefore the target of the pointer is the original meta type.
The second scenario is what you would expect as it takes implicit inheritance relationships into account.

I will not close the issue (just put it in the enhancement bucket) as it would probably worth to revisit getPointerPath + 'base' scenarios and either throwing exception or enhancing its behavior...

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

No branches or pull requests

2 participants