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

Elaboration of non-linear patterns #55

Open
PH111P opened this issue Dec 1, 2018 · 1 comment
Open

Elaboration of non-linear patterns #55

PH111P opened this issue Dec 1, 2018 · 1 comment
Assignees

Comments

@PH111P
Copy link

PH111P commented Dec 1, 2018

MosML elaborates the following code:

fun f x x = x;

as

> val ('a, 'b) f = fn : 'a -> 'b -> 'b

which does not conform to the Definition of SML'97. In particular, the code should simplify to

val rec f = fn vid1 => fn vid2 => case (vid1, vid2) of (x, x) => x;

which is in turn rejected by MosML with the following error message:

! Toplevel input:
! val rec f = fn vid1 => fn vid2 => case (vid1, vid2) of (x, x) => x;
!                                                        ^
! Illegal rebinding of x: the same value identifier is bound twice in a pattern

(Tested with version 2.10 on Arch Linux)

@kfl
Copy link
Owner

kfl commented Feb 19, 2019

Nice catch.

Thanks for the report.

@kfl kfl self-assigned this Feb 19, 2019
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