-
Notifications
You must be signed in to change notification settings - Fork 29
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
@report_opt reports runtime dispatch on abstract keyword arguments #269
Comments
It's not a false positive. In general, what The implementation of keyword argument scheme uses If you embed a global constant (like |
thanks for your quick reply!
This is unfortunate, as kw arguments make code much more robust and readable. |
Yeah, it might make sense to allow function kwIsType(; @nospecialize(a = nothing))
isa(a, DataType) && a.name === Type.body.name
end Maybe you want to file an issue at JuilaLang/julia ? |
I will, thanks for the hint! 👍 |
Hi,
the following base code causes a dispatch report.
However, variations with directly creating the S instance (V1) or doing it through 2 intermediate functions (V2) do not cause any report.
With this variation V3 (normal argument instead of kwargs), I don't get any report either.
This final variation V4, identical to the first one, but running within a module I don't get any report either.
Are all these results expected? If the dispatch reported by the original case is a true positive, is there a way to avoid it (apart from not using kwargs for the constructor and defining the field with a concrete type?)
thanks
The text was updated successfully, but these errors were encountered: