cgrand said: This bug is caused by top-level fns not being numbered anymore. Since their name doesn't change, the classCache in DynamicClassLoader finds the previous defintion, compares the expressions bodies (before macroexpansion) and thus concludes the cache entry is fresh and returns it.
I see two potential fixes:
- use a deeply macroexpanded body as the value of the cache entry, but this would require building this body – however it isn't enough, see http://gist.github.com/420344: hinting doesn't change value since it's metadata so the unhinted version keeps getting pulled from the cache. This is not an acceptable fix.
- use (wrapped) byte arrays as values (eg java.nio.ByteBuffer/wrap creates wrappers with value-based equality) but I don't know under which conditions a reload would produce two identical byte arrays – experimentally, types and records Classes are pulled from the cache when reloaded but fns aren't.