Hi Paul, On Sun, Jan 30, 2022 at 11:22 AM Paul Bryan <pbryan@anode.ca> wrote:
I suspect that `reveal_type` will see very little (if any) use at runtime, and will likely be removed by developers when static type debugging is completed to avoid console noise. If this is not true (if `reveal_type` may be retained in code after debugging) then I think it would actually be better for it to have no runtime behavior (e.g. like `cast`).
I see it as a debug tool that should be removed before commit, so for that use case the “print type” behavior is useful for iterating and going between running the code and type checking it, with useful debug type information both ways; it’s especially interesting to know if the runtime type does not match the static type. There’s been some discussion also of it’s possible use in test suites for typed libraries, but I haven’t fully followed the ins and outs of that. Carl