Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

game instance tree state lost when indexing up ancestors using .Parent #15

Closed
matthargett opened this issue Apr 19, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@matthargett
Copy link

when trying to require anything from script.Parent, I get messages like this:

src/Array/concat.lua(3,25): TypeError: Key 'isArray' not found in class 'Instance'

it looks like in the globalTypes.d.lua, it declares script: LuaSourceContainer. I can change that to any and it no longer emits this error as a workaround. It would be nice to not have to trade one for the other, though.

@JohnnyMorganz
Copy link
Owner

note that it doesn't actually affect require, but just indexing the tree.

require(script.Parent.Child) will resolve correctly and return typed code but the script.Parent.Child indexing part will currently error as we lose the game tree state and don't know that Child is a descendant of script.Parent.

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Apr 19, 2022
@JohnnyMorganz
Copy link
Owner

80f68a9 temporarily marks script as any, which will hopefully silence most of these spurious type errors for now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants