You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, say you need a type from moduleB in moduleA, but moduleB depends on moduleA. This causes a circular dependency
This shouldn't theoratically be necessary as types can be represented as references and don't usually run any code with side effects as everything is predefined (which if a feature was added with this effect it could be an exception to this)
Teal already has the syntax local type x = require("module"). I suggest that requires using that syntax shouldn't cause circular dependencies and the checker should be able to resolve this. This would be similar to typescript's "import type".
Having to have a seperate "types" file is kind of messy in my opinion and shouldn't be necessary, and I feel this change could be heavily beneficial.
Hope to see this implemented!
The text was updated successfully, but these errors were encountered:
local type = require("module") should already be able to circumvent some circular dependency issues. Could you provide a minimal tiestcase with two example modules which illustrate the problem you're seeing? Thanks!
Note that placement seemed to have no effect, but with an integer type in place of a record placement seemed to slightly mess with errors, although it seemed to always have an error
Also pretty sure this applies to global types as well
Right now, say you need a type from moduleB in moduleA, but moduleB depends on moduleA. This causes a circular dependency
This shouldn't theoratically be necessary as types can be represented as references and don't usually run any code with side effects as everything is predefined (which if a feature was added with this effect it could be an exception to this)
Teal already has the syntax
local type x = require("module")
. I suggest that requires using that syntax shouldn't cause circular dependencies and the checker should be able to resolve this. This would be similar to typescript's "import type".Having to have a seperate "types" file is kind of messy in my opinion and shouldn't be necessary, and I feel this change could be heavily beneficial.
Hope to see this implemented!
The text was updated successfully, but these errors were encountered: