You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The direct-call SCC graph cannot see recursion smuggled through a
captured var of function type (e.g. `var f = |x| 0; f = |x| f(x-1)`)
or through a function passed as a parameter (e.g. `b(n) { a(b, n) }`
where `a`'s body calls through the param). Tighten the rule so every
call site must be a direct reference to a top-level function
declaration: the callee must be an unshadowed `Expr::Id` that resolves
to a named function. Anything else — call through a parameter, a
var/let binding, a lambda expression, or a struct field — is reported
as an indirect call at the call site.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// ❌ ../tests/cases/checker/no_recursion_indirect.lyte:14:12: --no-recursion: indirect call is not allowed (callee must be a direct reference to a top-level function)
4
+
// return f(n - 1) + 1
5
+
// ^
6
+
// ❌ ../tests/cases/checker/no_recursion_indirect.lyte:23:19: --no-recursion: indirect call is not allowed (callee must be a direct reference to a top-level function)
7
+
// g = (|n: i32| g(n - 1))
8
+
// ^
9
+
//
10
+
// Indirect calls cannot be modelled by the direct-call graph, so they
11
+
// could otherwise smuggle recursion past --no-recursion via a captured
12
+
// var holding a lambda or a function passed as a parameter.
0 commit comments