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
When using %auto_lazy off, type checking sometimes accepts programs where a strict value is passed instead of a lazy value and vice versa. Examples:
%auto_lazy off
n:Nat
n =1m:Nat
m = delay n
k:Nat
k = force n
%auto_lazy off
main:IO()
main =putStrLn"Hello">>putStrLn {io=IO} "world"
The second argument of (>>) is lazy. Without delay typechecker throws Error: While processing right hand side of main. Can't find an implementation for HasIO ?io
but accepts if you explicitly pass IO.
%auto_lazy off
dataX=Af:Lazy X -> X
f x@A= x
main:IO()
main = ignore $ pure $ f A
This code successfully passes the type-check but generates an error when generating Scheme code:
Exception: attempt to reference unbound identifier pat0C-58-0 at line 648, char 47 of /project/directory/build/exec/_tmpchez_app/_tmpchez.ss
Expected Behavior
Error during type checking, like
Error: While processing right hand side of m. Can't solve constraint between: Lazy Nat and Nat.
Observed Behavior
Successfully passes the type-check.
The text was updated successfully, but these errors were encountered:
spcfox
changed the title
Inconsistence %auto_lazy off behavior
Inconsistent %auto_lazy off behavior
Nov 18, 2024
Steps to Reproduce
When using
%auto_lazy off
, type checking sometimes accepts programs where a strict value is passed instead of a lazy value and vice versa. Examples:The second argument of
(>>)
is lazy. Withoutdelay
typechecker throwsError: While processing right hand side of main. Can't find an implementation for HasIO ?io
but accepts if you explicitly pass
IO
.This code successfully passes the type-check but generates an error when generating Scheme code:
Expected Behavior
Error during type checking, like
Observed Behavior
Successfully passes the type-check.
The text was updated successfully, but these errors were encountered: