Navigation Menu

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

Surcharge de types #2418

Closed
vicuna opened this issue Apr 15, 2000 · 2 comments
Closed

Surcharge de types #2418

vicuna opened this issue Apr 15, 2000 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Apr 15, 2000

Original bug ID: 80
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Il me semble que le comportement suivant est un bug:

    Objective Caml version 2.99 (99/12/08)

type int = A;;

type int = A

A;;

  • : int = A

1;;

  • : int = 1

le type int étant surchargé, il faudrait mettre Pervasives.int sur la
dernière ligne. Camllight réagissait bien:

  Caml Light version 0.74

#type int = A;;
Type int defined.
#A;;

Cordialement,

Alain Frisch

@vicuna
Copy link
Author

vicuna commented Apr 17, 2000

Comment author: administrator

Il me semble que le comportement suivant est un bug:

    Objective Caml version 2.99 (99/12/08)

type int = A;;

type int = A

A;;

  • : int = A

1;;

  • : int = 1

le type int étant surchargé, il faudrait mettre Pervasives.int sur la
dernière ligne.

En fait, le type "int" ne fait pas partie du module Pervasives, c'est
un type prédéfini par le typeur en dehors de tout module. C'est vrai
que la documentation est légèrement mensongère à ce propos, pour des
raisons douteuses. Par conséquent, il n'y a pas d'autre nom pour
"int" que l'on puisse utiliser à l'affichage. C'est la même situation
que:

#type t = A;;
#type t = B;;
#A;;

  • : t = A

Camllight réagissait bien:

C'est vrai, mais Caml Light, lui, plaçait les types prédéfinis dans un
module spécial appelé "builtin".

Cordialement,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 5, 2002

Comment author: administrator

Correct behavior, but documentation should be fixed.

The documentation was fixed at some point in the past. -- Damien 2002-11-05

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