It would be nice to annotate the return type of methods with a constant qualifier, in order to have an efficient and safe behaviour at the same time.
I mean something like this: type A data::Vector{Int} end # invalid but desiderable julia code const function getdata(a::A) return a.data end a = A(ones(10)) data = getdata(a) data[1] = 2 # ERROR a.data[1] = 2 # OK