Re:Making the move from Scala to Go
by neilparikh on Thursday January 26, 2017 @11:22AM
(#13492637)
So the issue you faced was that you used z twice, and x not at all? In that case, linear types (http://edsko.net/2017/01/08/linearity-in-haskell/) may have caught that.
x not being used at all can be caught by a simple unused variable warning.
In this situation, the variable's value was used somewhere, so that didn't go off.
The type system would be of donkey all use here, because everything has the correct type, with or without the mistake. The code referred to the wrong thing of exactly the right type.
A lot of code works with numerous variables or object elements that are all of the same type, and can be mixed up without a diagnostic.