local @classes
#2584
Replies: 2 comments 3 replies
-
I like this but would prefer something like ---@class (local) MyClass
local MyClass = {} That way it would be pretty much the same syntax and could even be used with something like: ---@class (local, exact) MyClass
local MyClass = {} |
Beta Was this translation helpful? Give feedback.
1 reply
-
People usually need classes that are visible within a certain scope, rather than classes that are only visible in local files. I think restricting the namespace might be better. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I would like like to have...
...for classes whose usage is limited to the individual file. The only difference with
---@class
is that the class will be visible only to that particular file rather than globally. For example, stubs and fake classes for unit testing that don't have any other use except testing.Local classes can extend global classes, but global classes cannot extend local classes.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions