I'm debugging some Julia code and trying to figure out why the following doesn't work. (julia 0.6.3)
struct Foo
foo::String
end
k = Foo("bar")
finalizer(k, k->print("finalized!"))
While I expect it to print "finalized!", in actuality I get the following error:
ERROR: objects of type Foo cannot be finalized
Stacktrace:
[1] finalizer(::Any, ::Any) at ./base.jl:127
I could find very little documentation on finalizer function, and no examples, what am I doing wrong?