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

impression de contrainte de type utilisant le type de self #8082

Closed
vicuna opened this issue Mar 30, 2003 · 1 comment
Closed

impression de contrainte de type utilisant le type de self #8082

vicuna opened this issue Mar 30, 2003 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 30, 2003

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

Bug description

Full_Name: Vanicat Remi
Version: 3.06 et cvs
OS:
Submission from: ca-bordeaux-20-28.abo.wanadoo.fr (80.8.92.28)

Bonjour.

Si j'ai le fichier .ml suivant :
test.ml :
class ['a] container id =
object(s:'s)
val mutable id = (id : 'a)

method set (x : 'a) =
x #add_container s
end;;

alors la suite d'opération suivante donne un résulat pour le moins étrange :
moi@debian:/lang/ocaml/test/bug$ ocamlc -i -c test.ml > test.mli_tmp
moi@debian:
/lang/ocaml/test/bug$ mv test.mli_tmp test.mli
moi@debian:/lang/ocaml/test/bug$ rm .cm
moi@debian:
/lang/ocaml/test/bug$ ocamlc -c test.ml
The implementation test.ml does not match the interface test.cmi:
Class declarations do not match:
class ['a] container :
'a ->
object
constraint 'a = < add_container : < set : 'a -> 'b; .. > -> 'b; .. >
val mutable id : 'a
method set : 'a -> 'b
end
does not match
class ['a] container :
'a ->
object
constraint 'a = < add_container : < set : 'a -> 'b; .. > -> 'b; .. >
val mutable id : 'a
method set : 'a -> 'b
end
One type parameter has type
< add_container : < set : 'a -> 'b; .. > -> 'b; .. > as 'a
but is expected to have type
< add_container : < set : 'c -> 'd; .. > -> 'd; .. > as 'c

il semble que ce soit "juste" un problème d'affichage du type.

Une version similaire sans le
val mutable id = (id : 'a)
compile sans problème....

@vicuna
Copy link
Author

vicuna commented Apr 22, 2003

Comment author: administrator

Fixed by JG (2003-04-22)

@vicuna vicuna closed this as completed Apr 22, 2003
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant