haxetink / tink_macro

The macro toolkit
MIT License
57 stars 17 forks source link

Check if Function is void #36

Closed NQNStudios closed 3 years ago

NQNStudios commented 3 years ago

Given a haxe.macro.Function object, it would be great if there were a helper function that could tell me whether that function is type Void or not.

NQNStudios commented 3 years ago

I was thinking I would have to use ExprTools.iter() to inspect sub-expressions of the body for EReturn instances, but I just realized in my case checking ret.toString() == "Void" was sufficient.