I came across this when working on a gradient-based optimization example, using a function that called intpow as a test case.
def f (x:Float) : Float =
intpow x 2
x = 3.1
f x
> 9.61
grad f x
> Compiler bug!
> Please report this at github.com/google-research/dex-lang/issues
>
> Unsupported newtype: Nat
> CallStack (from HasCallStack):
> error, called at src/lib/Linearize.hs:515:10 in dex-0.1.0.0-56tlNzHvZd2Epf2TOu8iN7:Linearize
Well, the mega-rewrite #1209 did eliminate whatever the Nat problem was, but that just exposed another problem. Fortunately, the other one is easy to work around, which #1210 does.
I came across this when working on a gradient-based optimization example, using a function that called
intpow
as a test case.