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

prefer string to bytes with -short-paths #6827

Closed
vicuna opened this issue Mar 31, 2015 · 1 comment
Closed

prefer string to bytes with -short-paths #6827

vicuna opened this issue Mar 31, 2015 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Mar 31, 2015

Original bug ID: 6827
Reporter: @sliquister
Status: closed (set by @damiendoligez on 2015-04-07T18:52:21Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @hcarty

Bug description

When -safe-string is not used, -short-paths seems to always prefer saying "bytes" instead of "string", which is the opposite behaviour of what we want: if you don't say -safe-string, you don't care about the "bytes" type and you'd prefer to see "string" everywhere.

I suspect this behavior is an unintended consequence of the order in which predef.ml creates the type defs.

Steps to reproduce

$ ocaml
OCaml version 4.02.1

let 1 = "A";;

Error: This expression has type string but an expression was expected of type
int

$ ocaml -short-paths
OCaml version 4.02.1

let 1 = "A";;

Error: This expression has type bytes but an expression was expected of type
int

@vicuna
Copy link
Author

vicuna commented Apr 7, 2015

Comment author: @damiendoligez

Fixed in trunk (rev 15987) by switching the definitions of bytes and string.

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