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

incorrect example code in 20.9.2 Unboxing of specialised arguments #7322

Closed
vicuna opened this issue Aug 6, 2016 · 4 comments
Closed

incorrect example code in 20.9.2 Unboxing of specialised arguments #7322

vicuna opened this issue Aug 6, 2016 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Aug 6, 2016

Original bug ID: 7322
Reporter: junsli
Status: closed (set by @damiendoligez on 2016-09-27T14:26:48Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: documentation
Tags: junior_job
Monitored by: @gasche

Bug description

Call site of loop' seems incorrect.

let f x =
let rec loop' xs inv_0 inv_1 =
match xs with
| [] -> inv_0 + inv_1
| x::xs -> x + loop2' xs inv_0 inv_1
and loop2' ys inv_0 inv_1 =
match ys with
| [] -> 4
| y::ys -> y - loop' ys inv_0 inv_1
in
Printf.printf "%d\n" (loop' (x + 42) (x + 43) [1; 2; 3])

If this phase doesn't change the order of arguments, the call is supposed to be

loop' [1; 2; 3] (x + 42) (x + 43)

@vicuna
Copy link
Author

vicuna commented Aug 6, 2016

Comment author: @gasche

Good catch!

This one should be rather easy to fix it by yourself -- "git grep" would let you easily locate that example in the distribution. Would you be willing to give it a try?

@vicuna
Copy link
Author

vicuna commented Aug 6, 2016

Comment author: junsli

Absolutely. I'll send a pull request later.

@vicuna
Copy link
Author

vicuna commented Aug 6, 2016

Comment author: junsli

See GPR #745

@vicuna
Copy link
Author

vicuna commented Sep 27, 2016

Comment author: @damiendoligez

#745 was merged on August 8 (commit 73bb1bf).

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

No branches or pull requests

1 participant