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

type inference on record update in let doesn't work based on RHS #327

Open
shmish111 opened this issue Apr 26, 2020 · 2 comments
Open

type inference on record update in let doesn't work based on RHS #327

shmish111 opened this issue Apr 26, 2020 · 2 comments

Comments

@shmish111
Copy link
Contributor

Steps to Reproduce

Check

f : A -> A
f a =
    let x = record { fieldA = 1 } a
    in ?x

Expected Behavior

Checks successfully

Observed Behavior

Errors (1)
Test.idr:203:13
While processing right hand side of f at Test.idr:202:1--205:1:
Can't infer type for this record update

However if I replace ?x with x it will type check.

@edwinb
Copy link
Owner

edwinb commented Apr 27, 2020

I can't reproduce this because you haven't included the full example.

@shmish111
Copy link
Contributor Author

Ooops:

record A where
    constructor MkR
    fieldA : Int

f : A -> A
f a =
    let x = record { fieldA = 1 } a
    in ?x

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

2 participants