-
-
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
zero() and one() for incomplete and abstract types #4808
Comments
+1 for making all of these errors. |
I agree that these should be errors for abstract types. |
@StefanKarpinski What about incomplete types like |
It seems like anything that's not a complete concrete type is problematic since, while you may be able to pick some zero value that's of that type, it's always somewhat arbitrary since there will be other ones that could be picked. |
would |
Currently that only really makes sense for Number, not Any. I'm skeptical about one and zero for Any. |
|
If this issue hasn't been discussed elsewhere, could it get a This came up in this thread recently: https://discourse.julialang.org/t/why-isa-x-1-y-1-array-tuple-stuff-number-1-false/55777 |
The current state of zero and one seems unexpected for incomplete and abstract types. I think all these cases should result in an error.
Some relevant discussion in #3728, but I'm opening a new one because it is marked as fixed.
Edited to add:
I also want errors for arrays of incomplete and abstract types, but i have not figured out the relationship between
zero
andzeros
andone
andonses
. That might be a separate issue.The text was updated successfully, but these errors were encountered: