-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expr constructor sometimes returns a Symbol, Bool, etc #308
Comments
Yeah, the meaning of this function is "what would |
Another option would be to do a check in the caller: if converts_to_expr(myex)
ex = Expr(myex)
else
# whatever else
end I came here because of quite a large number of invalidations triggered by this function; making it more inferrable would eliminate those. Since your But I don't know enough about the package to make a quick tweak. You don't have to do anything about this (and I'm not sure I'm planning on it either), but I thought I'd report this just on the general principle that a constructor that lies is a bit confusing. |
Is there a strong need for this to be a constructor for |
I don't think this particular |
Examples:
CSTParser.jl/src/conversion.jl
Lines 137 to 142 in 778212a
I worry it's troubling to claim to be a constructor of a type and not return that type. That method could be called
expr_or_symbol
, or it could always return anExpr
the way that Base does.EDIT: but
_literal_expr
is going to be real trouble. Maybe this should beexpr_or_literal
?The text was updated successfully, but these errors were encountered: