is there a way to query the type of an unannotated funcion? #1148
-
say I have an identity function
how do I look up the inferred type of this function? |
Beta Was this translation helpful? Give feedback.
Answered by
AmaranthineCodices
Jan 17, 2024
Replies: 1 comment 1 reply
-
Yes, but it requires C++ code to access the type checker's result in the general case. If you just want to see it for debugging purposes, the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
capfredf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, but it requires C++ code to access the type checker's result in the general case. If you just want to see it for debugging purposes, the
luau-analyze
CLI tool has a--annotate
flag you can pass that will print the analyzed source to stdout with type annotations attached. These type annotations are not necessarily valid Luau source code, but they do show the actual types we inferred.