Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot infer type after case in lazy lambda #3418

Open
spcfox opened this issue Nov 20, 2024 · 1 comment
Open

Cannot infer type after case in lazy lambda #3418

spcfox opened this issue Nov 20, 2024 · 1 comment

Comments

@spcfox
Copy link
Contributor

spcfox commented Nov 20, 2024

Steps to Reproduce

foo : Lazy (() -> ())
foo = \x => the () $ case x of () => ()

bar : Lazy (() -> ())
bar = \x => case x of () => ()

Expected Behavior

Both functions will pass the type check

Observed Behavior

foo successfully passes type checking, but bar doesn't:

Error: While processing right hand side of bar. Can't solve constraint between: () and ?caseTy [no locals in scope].

Test:7:29--7:31
 3 | foo : Lazy (() -> ())
 4 | foo = \x => the () $ case x of () => ()
 5 | 
 6 | bar : Lazy (() -> ())
 7 | bar = \x => case x of () => ()
                                 ^^
@spcfox
Copy link
Contributor Author

spcfox commented Nov 21, 2024

This function also successful typechecking

baz : Lazy (() -> ())
baz = the (_ -> _) $ \x => case x of () => ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant