Hacker News new | ask | show | jobs
by objectiveariel 3224 days ago
You're missing the point. The fact that the language still allows you to write `p.isImmortal = true;` is the issue.
2 comments

And my linter, or flow, typescript will pick that up in the same way the compiler will. Just because tooling these days catches these things in 'type safe' languages doesn't mean it's not a pointer to a chunk of memory that's defined at runtime beneath it all.
Which won't do anything. p.isImmortal will still be the setter. So it's a non issue -- and the linter can catch the mistake anyway.