-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Color incompletely specified type parameters in @code_warntype
differently
#41251
Comments
Containers with non-concretely typed fields do not introduce type instabilities per se. It is only if you access the field that a type instability is introduced and in this case |
Right, I'm aware of that. Type parameters are usually used to specify field types though, so having those incompletely specified will in most cases lead to type instabilities down the road, when accessing those fields (if the field is never accessed, why have it in the first place?). The problem is that this isn't apparent from Moreover, if you don't know that |
When using
@code_warntype
to check for type instabilities, sometimes some instability is induced by accessing incompletely specified type parameters/fields:In the above
@code_warntype
, all instances whereContainer{SMatrix{1, 1, Int64}}
is printed are blue, indicating type stability. Using that type and accessing its field however induces type instability, since its field is neither abstractly nor concretely typed. I think coloring that incompletely specified type parameter differently (yellow? red?) would be a good idea.The text was updated successfully, but these errors were encountered: