Vectors & typechecker? #385
-
I'm trying to register variables/functions with vector types for the typechecker, but primitive vector types seem to be missing. For example, they are not in SingletonTypes or TypeChecker where numberType, stringType, booleanType are. How can I register variables and functions that use vectors? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
https://github.com/Roblox/luau/blob/master/fuzz/proto.cpp#L101-L115 has a basic example (note that it omits other metamethods for simplicity); from the type checkers perspective right now vector isn't a primitive type (we mostly didn't have to change this when introducing a new primitive type, but also type checker currently may not always respect metatable __index so replacing this with a primitive type may require further work inside the type checker). |
Beta Was this translation helpful? Give feedback.
https://github.com/Roblox/luau/blob/master/fuzz/proto.cpp#L101-L115 has a basic example (note that it omits other metamethods for simplicity); from the type checkers perspective right now vector isn't a primitive type (we mostly didn't have to change this when introducing a new primitive type, but also type checker currently may not always respect metatable __index so replacing this with a primitive type may require further work inside the type checker).