type SubValue {
n
}
type Value {
{SubValue} sub
}
type Pointer {
{Value} value
{Pointer} p
}
software {
var p = Pointer()
p.value.sub.n = 5
var t = p.value
p.value = Value()
print(t.sub.n)
}
There is currently a dangling pointer issue here.
Instead of creating very evil bugs, the language should have an ownership system of sorts.
When this happens:
var t = p.value
p.value = Value()
This should imply that 't' has taken the value of 'p.value' and now 'p.value' is empty.
This should stop such dangling pointer bugs from occurring.
Consider the code:
There is currently a dangling pointer issue here. Instead of creating very evil bugs, the language should have an ownership system of sorts. When this happens:
This should imply that 't' has taken the value of 'p.value' and now 'p.value' is empty. This should stop such dangling pointer bugs from occurring.