Notice that there’s no type inference, even though there should be.
Expected Behavior
You should be able to see the type of data returned when requiring a module through a dictionary or array.
Actual Behavior
When using a table require path, you get the following result:
Workarounds
The only workaround is to not use table require paths, which in my workflow is heavily undesired. Intellisense speeds up my work and should apply to all types of paths, as long as it ends in a module script.
Not sure if this is a bug or intended behavior, but if it should be fixed straight away no matter what.
Issue Area: Studio Issue Type: Other Impact: High Frequency: Constantly
It’s unlikely that this is going to be fixed any time soon.
Module require dependencies are solved before typechecking is performed.
This is similar how C++ #include dependencies are found without compiling C++ or Rust modules are looked up.
Rust does have macros to get some flexibility on module references, but it’s like a second language on top.
Not saying that Luau should be bad like C++ or Rust, but for context on how these complications come in when dealing with dependencies.
We have some ideas on resolving requires that are resolved late during the type solve, but it’s tricky with how you have to interrupt active module typecheck to check one or more other modules.