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
wish : methode polymorphe et type contraint #8030
Comments
Comment author: administrator From: lvibert@irisa.fr
Effectivement, il y avait un bug. C'est maintenant corrige' en CVS.
En fait, si ca marche c'est un peu par hasard: dans cet exemple 'a Si on ecrit plutot Attention, pour des raisons techniques, la notation explicite Jacques |
Comment author: administrator Je crois que c'est maintenant corrige' en CVS.
class type o = object endclass ['a] c = object constraint 'a = #o end;; class type c2 = object method m : 'a. 'a c end;;class type c2 = object method m : #o c end class type c2 = object method m : 'a. (_ c) as 'a end;;This type scheme cannot quantify 'a : it is not a variable. class type c2 = object method m : 'a. (#o as 'a) c end;;class type c2 = object method m : #o c end class type c2 = object method m : #o c end;;class type c2 = object method m : #o c end Comme ca a demande' pas mal de changement, merci de verifier que ca ne casse Jacques |
Comment author: administrator Fixed by JG (2003-05-19) |
Original bug ID: 1559
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Laurent Vibert
Version: 3.06
OS:
Submission from: cafe.irisa.fr (131.254.22.19)
Bonjour,
Quand une variable est contrainte, je ne vois aucun moyen de la rendre
polymorphe :
class type o = object end
class ['a] c = object constraint 'a = #o end
class type c2 = object method m : 'a. 'a c end;;
(* This type 'a should be an instance of type #o as 'b = < .. > *)
class type c2 = object method m : 'a. (_ c) as 'a end;;
(* This type has no row variable *)
class type c2 = object method m : 'a. (#o as 'a) c end;;
(* This type #o should be an instance of type #o as 'a = < .. >
The universal variable 'b would escape its scope *)
par contre, ceci marche parfaitement , mais ce n'est pas ce qu'on voulait :
class type c2 = object method m : 'a. (_ #c) as 'a end;;
The text was updated successfully, but these errors were encountered: