Invalidate fastfuncs whose dependencies are overridden
I should find a nice small example (of a fastfunc that should change behavior when some other fastfunc that has been inlined into it gets overridden). Until then, just noting that this is currently a bug, as in, we're not to spec on this one.
I should find a nice small example
dedup is the only function that uses foldl; therefore, if foldl were redefined to always return nil, dedup should always return nil — if it doesn't, that's a fastfunc-related bug.
The problem is, right now, it actually works:
> (dedup '(a b c c b a c))
(a b c)
> (def foldl (f base . args) nil)
(lit clo nil (f base . args) nil)
> (foldl cons nil '(1 2 3 4 5))
nil
> (dedup '(a b c c b a c))
nil
Because we don't have a dedup fastfunc yet. In order to expose this bug, we'd need one first.
In PR #313 (which has a dedup fastfunc), the problem now manifests:
> (dedup '(a b c c b a c))
(a b c)
> (def foldl (f base . args) nil)
(lit clo nil (f base . args) nil)
> (foldl cons nil '(1 2 3 4 5))
nil
> (dedup '(a b c c b a c))
(a b c)
In PR #313 (which has a dedup fastfunc) [...]
...now merged, which means we have this problem on the master branch, too.
Incidentally, it's not altogether different from #170, which would also misbehave now under an appropriate test case:
> (bind foldl (fn (f base . args) nil) (dedup '(a b c c b a c)))
(a b c)
breakc is another good example; its dependency is syntax, a global variable.