-
Notifications
You must be signed in to change notification settings - Fork 45
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
Rename node helpers #187
Rename node helpers #187
Conversation
inline fun <T : Node> Node.node(path: String) = getNode(NodePath(path)) as T? | ||
|
||
@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST") | ||
inline fun <T : Node> Node.node(nodePath: NodePath) = getNode(nodePath) as T? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the rename necessary? It works for me if they just have a different package path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for getNode(String) but not for getNode(NodePath) in my case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's suggested but when I select it, it still doesn't work, the import is not made so I just get a red line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good to test out latest kotlin versions and enabling JVM IR - from what I understand the code still compiles but the only IDE marks it as red?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the package change, but I'm not too sure about the rename.
I just did a test, moving to a different package only hides the issue - when you start using the helpers the problem can occur - so a rename is a must. I think we need a way to tell the helper is connected to |
Hmm weird. I dont seem to have those issues. Anyways. Then I'm all in for either just |
|
GetNodeAs seems nice, it creates a whole sentence that way |
Extensions are now in their own package and I split them into 2 files, one for Object, one for Node.
Also because of a conflict with the "getNode" name, the helpers have been rename simple "node".
related issue : #183