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

Toplevel with -short-paths doesn't select shortest type paths #6763

Closed
vicuna opened this issue Jan 29, 2015 · 3 comments
Closed

Toplevel with -short-paths doesn't select shortest type paths #6763

vicuna opened this issue Jan 29, 2015 · 3 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Jan 29, 2015

Original bug ID: 6763
Reporter: dsheets
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:49:05Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Fixed in version: 4.02.2+dev / +rc1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @gasche

Bug description

$ ocaml -short-paths
OCaml version 4.02.1

#show_module Hex;;

module Hex :
sig
val of_char : char -> char * char
val to_char : char -> char -> char
type t = [ `Hex of CamlinternalFormatBasics.char_set ]
val of_string : ?pretty:bool -> CamlinternalFormatBasics.char_set -> t
val to_string : t -> CamlinternalFormatBasics.char_set
end

but when using ocamlc:

$ ocamlfind ocamlc -package hex -i test_sp.ml
val of_char : char -> char * char
val to_char : char -> char -> char
type t = [ `Hex of string ]
val of_string : ?pretty:bool -> string -> t
val to_string : t -> string

$ ocamlfind ocamlc -short-paths -package hex -i test_sp.ml
val of_char : char -> char * char
val to_char : char -> char -> char
type t = [ `Hex of bytes ]
val of_string : ?pretty:bool -> bytes -> t
val to_string : t -> bytes

Steps to reproduce

Install 4.02.1 and use -short-paths with the toplevel.

Additional information

utop 1.17 (latest) has -short-paths on by default.

@vicuna
Copy link
Author

vicuna commented Jan 30, 2015

Comment author: @garrigue

Could you explain what is wrong ?
For which type Is there a shorter path available ?

@vicuna
Copy link
Author

vicuna commented Jan 30, 2015

Comment author: @garrigue

Note that if you are talking about the fact string is turned into bytes (which is certainly not longer), this just follows the specification of short-paths: choose the equivalent path with the smallest number of dots, and the most recent one if the length is identical. Since in the unsafe environment bytes is defined as if it were
type bytes = string
this results in bytes being the most recent one.

@vicuna
Copy link
Author

vicuna commented Jan 30, 2015

Comment author: @garrigue

Sorry, I misunderstood the problem.
This was about the show directive, which didn't set a printing environment for short-paths.

Fixed in trunk and 4.02 at revisions 15798 and 15799.

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

2 participants