Skip to content
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

Array{Int}() gives strange result #11180

Closed
garrison opened this issue May 7, 2015 · 5 comments
Closed

Array{Int}() gives strange result #11180

garrison opened this issue May 7, 2015 · 5 comments

Comments

@garrison
Copy link
Member

garrison commented May 7, 2015

As noticed here, Array{Int}() fails on julia 0.3:

julia> Array{Int}()
ERROR: type cannot be constructed

but leads to a rather weird result on master:

julia> Array{Int}()
0-dimensional Array{Int64,0}:
-1229782938247303442

This behavioral change was introduced in 23a6995.

@JeffBezanson
Copy link
Member

Did you read the two issues that that commit closed? What would you suggest?

@garrison
Copy link
Member Author

garrison commented May 7, 2015

I did. But I'm not quite sure what the -1229782938247303442 is about. If making a 0-dimensional array is really what we want to do in this case, then I'd suggest removing whatever is causing that to be displayed.

@garrison
Copy link
Member Author

garrison commented May 7, 2015

Sorry, I just had the epiphany that a zero-dimensional array is a scalar, and this is simply an uninitialized scalar. I guess this will be "fixed" by #9147 if that is implemented as planned.

@garrison
Copy link
Member Author

garrison commented May 7, 2015

But as a new user, I would find the current behavior rather confusing.

@jakebolewski
Copy link
Member

Closing it as a dupe of #9147.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants