b2d
Re:Ask HN: What metaprogrammable language do you/would like to use?
on Tuesday April 23, 2019 @06:18AM (#19727116)
Incorrect. To quote the page you've linked: "For the most part, this type is identical to Expr, but it allows constraining the type of accepted expressions." or otherwise put: ExprOf only affects macro arguments, not return value. What you want is this:
class StringGetter {
public static macro function getString() {
var s:String = "";
return macro ($v{s} : Int);
}
}