Idris2-boot icon indicating copy to clipboard operation
Idris2-boot copied to clipboard

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

Open shmish111 opened this issue 5 years ago • 2 comments

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.

shmish111 avatar Apr 26 '20 13:04 shmish111

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

edwinb avatar Apr 27 '20 12:04 edwinb

Ooops:

record A where
    constructor MkR
    fieldA : Int

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

shmish111 avatar Apr 27 '20 13:04 shmish111