AshleyYakeley / Truth

Changes and Pinafore projects. Pull requests not accepted.
https://pinafore.info/
GNU General Public License v2.0
32 stars 0 forks source link

Incorrect type inference with record constructors #192

Closed AshleyYakeley closed 1 year ago

AshleyYakeley commented 1 year ago

Consider:

datatype P of
    MkP of
        r1: Unit;
        r2: Unit;
    end;
end;

test = fn f1, a1, f2, a2 => let
    r1 = f1 a1;
    r2 = f2 a2;
    in MkP;

Inferred: test: (a -> Unit) -> a -> (a -> Unit) -> a -> P Correct: test: (a -> Unit) -> a -> (b -> Unit) -> b -> P

This doesn't happen with e.g. Unit *: Unit instead of P.

AshleyYakeley commented 1 year ago

Fixed.