Closed nqpz closed 9 months ago
Monomorphisation is probably to blame, as it produces a function with this form:
def f ((s: {n: i64})) : ?[d<{s.n}>].[d<{s.n}>]i64 =
let (d<{s.n}>: i64) = s.n
let f' ((f: i64 -> i64)) ((a: i64)): ?[d<{s.n}>].[d<{s.n}>]i64 =
f'' d<{s.n}> f a
in f' id 0
Note how d<{s.n}>
is shadowed in the return type of f
. That probably confuses defunctionalisation, which ultimately produces something bad.
The program
compiled with
futhark c
from git produces this error: