diff options
| author | Xavier Clerc <xavier.clerc@inria.fr> | 2010-05-03 09:40:52 +0000 |
|---|---|---|
| committer | Xavier Clerc <xavier.clerc@inria.fr> | 2010-05-03 09:40:52 +0000 |
| commit | 3c6b91455e8aae0213d54a1c0a72f50e402594f9 (patch) | |
| tree | 4a068ad880cb114ee38c9b266d43fedad5742eed | |
| parent | f80a60d1a0bbefaf4c5a2f7ec0975f052d5dc414 (diff) | |
| download | ocaml-3c6b91455e8aae0213d54a1c0a72f50e402594f9.tar.gz | |
The warning related to method overriding is now disabled.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10351 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| -rw-r--r-- | testsuite/tests/typing-objects/Exemples.ml.reference | 127 | ||||
| -rw-r--r-- | testsuite/tests/typing-objects/Tests.ml.reference | 55 |
2 files changed, 5 insertions, 177 deletions
diff --git a/testsuite/tests/typing-objects/Exemples.ml.reference b/testsuite/tests/typing-objects/Exemples.ml.reference index 42fa5963f0..aa95aaead6 100644 --- a/testsuite/tests/typing-objects/Exemples.ml.reference +++ b/testsuite/tests/typing-objects/Exemples.ml.reference @@ -121,41 +121,9 @@ Type point = point is not a subtype of color_point = color_point print_string (self#color); print_string ")" end;; -[mWarning 7: the following methods are overriden by the class printable_point : - get_x move -[A[A[A[A[A[A[A[A[A[A[A[A[A# - class printable_color_point y c = object (self) - inherit color_point y c - inherit [4mprintable_point y[m as super - method print = - print_string "("; - super#print; - print_string ", "; - print_string (self#color); - print_string ")" - end;; -[m - -Warning 13: the following instance variables are overriden by the class printable_point : +[mWarning 13: the following instance variables are overriden by the class printable_point : x The behaviour changed in ocaml 3.10 (previous behaviour was hiding.) -[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A# - class printable_color_point y c = object (self) - inherit color_point y c - inherit printable_point y as super - [4mmethod print = - print_string "("; - super#print; - print_string ", "; - print_string (self#color); - print_string ")"[m - end;; -[m - - - - -Warning 7: the method print is overridden. class printable_color_point : int -> string -> @@ -304,18 +272,7 @@ val pr : < x : int; .. > list -> unit = <fun> method set_x : 'a -> unit method x : 'a end -# [A[A[A[A[A[A[A[A[A[A# - class ['a] double_link x = object (self) - inherit ['a] link x - val mutable prev = None - method prev = prev - [4mmethod set_next l = - next <- l; - match l with Some l -> l#set_prev (Some self) | None -> ()[m - method set_prev l = prev <- l - end;; -[mWarning 7: the method set_next is overridden. -class ['a] double_link : +# class ['a] double_link : 'a -> object ('b) val mutable next : 'b option @@ -362,85 +319,7 @@ class ['a] double_link : # - : float = 5. # - : float = 1.5 # - : float = 15. -# [A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A# - class calculator arg acc = object (self) - val arg = arg - val acc = acc - method enter n = new calculator n acc - method add = new calculator_add arg self#equals - method sub = new calculator_sub arg self#equals - method equals = arg - end and calculator_add arg acc = object - inherit calculator arg acc - [4mmethod enter n = new calculator_add n acc[m - method equals = acc +. arg - end and calculator_sub arg acc = object - inherit calculator arg acc - method enter n = new calculator_sub n acc - method equals = acc -. arg - end;; -[mWarning 7: the method enter is overridden. -[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A# - class calculator arg acc = object (self) - val arg = arg - val acc = acc - method enter n = new calculator n acc - method add = new calculator_add arg self#equals - method sub = new calculator_sub arg self#equals - method equals = arg - end and calculator_add arg acc = object - inherit calculator arg acc - method enter n = new calculator_add n acc - [4mmethod equals = acc +. arg[m - end and calculator_sub arg acc = object - inherit calculator arg acc - method enter n = new calculator_sub n acc - method equals = acc -. arg - end;; -[m -Warning 7: the method equals is overridden. -[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A# - class calculator arg acc = object (self) - val arg = arg - val acc = acc - method enter n = new calculator n acc - method add = new calculator_add arg self#equals - method sub = new calculator_sub arg self#equals - method equals = arg - end and calculator_add arg acc = object - inherit calculator arg acc - method enter n = new calculator_add n acc - method equals = acc +. arg - end and calculator_sub arg acc = object - inherit calculator arg acc - [4mmethod enter n = new calculator_sub n acc[m - method equals = acc -. arg - end;; -[m - -Warning 7: the method enter is overridden. -[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A# - class calculator arg acc = object (self) - val arg = arg - val acc = acc - method enter n = new calculator n acc - method add = new calculator_add arg self#equals - method sub = new calculator_sub arg self#equals - method equals = arg - end and calculator_add arg acc = object - inherit calculator arg acc - method enter n = new calculator_add n acc - method equals = acc +. arg - end and calculator_sub arg acc = object - inherit calculator arg acc - method enter n = new calculator_sub n acc - [4mmethod equals = acc -. arg[m - end;; -[m - - -Warning 7: the method equals is overridden. -class calculator : +# class calculator : float -> float -> object diff --git a/testsuite/tests/typing-objects/Tests.ml.reference b/testsuite/tests/typing-objects/Tests.ml.reference index 5c26800ed0..d93c5ec0ab 100644 --- a/testsuite/tests/typing-objects/Tests.ml.reference +++ b/testsuite/tests/typing-objects/Tests.ml.reference @@ -151,65 +151,14 @@ and 'a t = 'a t u # class ['a] c : 'a #c -> object end # class c : unit -> object method f : int end and d : unit -> object method f : int end -# [A# class e () = object inherit c () inherit [4md ()[m end;; -[mWarning 7: the following methods are overriden by the class d : - f -class e : unit -> object method f : int end +# class e : unit -> object method f : int end # - : int = 2 # [A# class c () = object val x = - [4mtrue[m val y = -. () end;; [mError: This expression has type bool but an expression was expected of type int # class c : unit -> object method f : int method g : int method h : int end # class d : unit -> object method h : int method i : int method j : int end -# [A[A[A[A[A[A[A[A# class e () = object - method f = 3 - inherit [4mc ()[m - method g = 3 - method i = 3 - inherit d () - method j = 3 - end;; -[mWarning 7: the following methods are overriden by the class c : - f -[A[A[A[A[A[A[A[A[A[A# class e () = object - method f = 3 - inherit c () - [4mmethod g = 3[m - method i = 3 - inherit d () - method j = 3 - end;; -[m - -Warning 7: the method g is overridden. -[A[A[A[A[A[A[A[A[A[A[A# class e () = object - method f = 3 - inherit c () - method g = 3 - method i = 3 - inherit [4md ()[m - method j = 3 - end;; -[m - - -Warning 7: the following methods are overriden by the class d : - h i -[A[A[A[A[A[A[A[A[A[A[A[A[A# class e () = object - method f = 3 - inherit c () - method g = 3 - method i = 3 - inherit d () - [4mmethod j = 3[m - end;; -[m - - - - -Warning 7: the method j is overridden. -class e : +# class e : unit -> object method f : int |
