Version française
Home     About     Download     Resources     Contact us    
Browse thread
class type param constraint
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Radzevich Belevich <radzevich.belevich@g...>
Subject: class type param constraint
class [ 'c ] a = 
  object(self)                  
    constraint 'c = < .. >
    method as_c =  (self :> 'c)
    method id = Oo.id self
  end          ;;
class ['a] a :
  object ('a)
    constraint 'a = < as_c : 'a; id : int; .. >
    method as_c : 'a
    method id : int
  end
================

Why type 'c must have methods "as_c" and "id" ?