Ask HN: What metaprogrammable language do you/would like to use? 7 years ago
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);
}
}