3 ms·
Language features like type promotion or automatic casting to default/zero values are likely to change how the new function is called, purely based on the chang
by hansvm 3y ago
Language features like type promotion or automatic casting to default/zero values are likely to change how the new function is called, purely based on the change in type signature. Even if every old input has the same output in the new function, old code can compile to produce a new input and have broken behavior. That's ignoring any metaprogramming or more complicated type shenanigans.
Is there something special about Clojure making that change safe?
- layer8 3y agoI don’t know about Clojure specifically, but Java and the JVM have bridge methods for such purposes. Meaning, a hidden method with the old type signature would still get generated whose implementation transparently forwards to the new method with the changed type signature, e.g. converting the T value to an Optional<T> value (or whatever).