Skip to content

Question: Dynamic property access? #163

Description

@monskov

Im writing a similar system to useEvent, came across the error myself, then came over here to see how you guys did it, but youre doing the same thing.

https://github.com/matter-ecs/matter/blob/f31981ba5dbc481f637c08e9fa3765419d566501/lib/hooks/useEvent.luau#L13C3-L13C30

TypeError: Attempting a dynamic property access on type 'Instance' is unsafe and may cause exceptions at runtimeLuau[1036](https://luau-lang.org/typecheck)

So is this error just old? Can you dynamically access properties safely now? The file in which you guys do this isnt typechecked so maybe it just flew under the radar? Either way im not sure if theres any alternative for what we're trying to do.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions