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

Typage sans -rectypes quand une interface a été compilée avec -rectypes: problème et suggestion #4000

Closed
vicuna opened this Issue Apr 11, 2006 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

commented Apr 11, 2006

Original bug ID: 4000
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @garrigue on 2006-06-26T09:41:54Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.09.1
Fixed in version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @alainfrisch

Bug description

Soit un module A compilé avec -rectypes et qui définit uniquement:

type t = t -> t

Alors, si on compile sans -rectypes

let f x = ((x : A.t), x = [x])

ça marche, mais avec:

let f x = (x = [x], (x : A.t))

ça échoue.

Le Dogme a été transgressé.

Plus généralement, il faudrait définir ce qu'il se passe lorsqu'une interface compilée -rectypes est utilisée par un module compilé sans -rectypes. Suite à une discussion avec Didier, deux propositions:

  • lorsque l'on déroule une abbreviation, vérifier que l'on n'est pas en train d'ouvrir un cycle;

  • interdire de compiler un module sans -rectypes s'il utilise une interface compilée avec -rectypes.

-- Alain

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 16, 2006

Comment author: @alainfrisch

Euh, évidemment, c'est "type t = t list"...

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 16, 2006

Comment author: @garrigue

Je ne vois pas immediatement comment implementer la premiere suggestion (verification de la presence d'un cycle lorsqu'on deroule un abbreviation pre-existente.)
La deuxieme option est evidemment plus simple, et relativement naturelle.
Mais ca peut compliquer les Makefiles.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 26, 2006

Comment author: @garrigue

Solved following the second option: -rectypes is now required for compiling
any dependency of an interface compiled with -rectypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.