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
import{Real,Vec,fn,vec}from"rose";constfoo=fn([Real,Real],Real,(x,y)=>{constz=f(x,y);constw=g(x,z);constu=h(z);constv=α(w,u);returnv;});constbar=fn([Vec(n,{x: Real,y: Real})],Vec(n,Real),(vals)=>vec(n,Real,(i)=>{const{ x, y }=vals[i];returnf(x,y);}));
The x and y variables inside the body of the vec both get typed as symbol, when they should be typed as Real, causing this error in the call to f:
Argument of type 'symbol' is not assignable to parameter of type 'Real'.
If you add an as const after the { x: Real, y: Real } type, the correct behavior occurs, but this is ugly. There should be a way to handle these sorts of types without the user having to write as const.
The text was updated successfully, but these errors were encountered:
Consider this example:
The
x
andy
variables inside the body of thevec
both get typed assymbol
, when they should be typed asReal
, causing this error in the call tof
:If you add an
as const
after the{ x: Real, y: Real }
type, the correct behavior occurs, but this is ugly. There should be a way to handle these sorts of types without the user having to writeas const
.The text was updated successfully, but these errors were encountered: