-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Segmentation fault #4208
Comments
More minimal version: julia> type a
a
end
julia> a(5)
Segmentation fault (core dumped) You probably shouldn't have the type and variable be the same name, but it shouldn't segfault. |
Also, if you want types a and b to be subtypes of c, you should specify them as such: abstract C
type A <: C
n::Int64
end
type B <: C
n::Int64
end
d(a::C) = print(a.n)
julia> d(A(5))
5 As a convention, types in Julia also have capital letters, so they can be distinguished more easily from variables. |
Thank you for pointing out the dump part of the issue. I did not remember to add the |
Yep, just a convention! It also might explain why this issue hasn't been noticed before. |
On the latest julia build I get this:
Should this code work, and give me a function d that works on both a and b? My impression is that it should at least not segfault, and jeff usually fix these issues really fast.
The text was updated successfully, but these errors were encountered: