summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Clerc <xavier.clerc@inria.fr>2010-05-03 09:40:52 +0000
committerXavier Clerc <xavier.clerc@inria.fr>2010-05-03 09:40:52 +0000
commit3c6b91455e8aae0213d54a1c0a72f50e402594f9 (patch)
tree4a068ad880cb114ee38c9b266d43fedad5742eed
parentf80a60d1a0bbefaf4c5a2f7ec0975f052d5dc414 (diff)
downloadocaml-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.reference127
-rw-r--r--testsuite/tests/typing-objects/Tests.ml.reference55
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;;
-Warning 7: the following methods are overriden by the class printable_point :
- get_x move
-#
- class printable_color_point y c = object (self)
- inherit color_point y c
- inherit printable_point y as super
- method print =
- print_string "(";
- super#print;
- print_string ", ";
- print_string (self#color);
- print_string ")"
- end;;
-
-
-Warning 13: the following instance variables are overriden by the class printable_point :
+Warning 13: the following instance variables are overriden by the class printable_point :
x
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-#
- class printable_color_point y c = object (self)
- inherit color_point y c
- inherit printable_point y as super
- method print =
- print_string "(";
- super#print;
- print_string ", ";
- print_string (self#color);
- print_string ")"
- end;;
-
-
-
-
-
-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
-# #
- class ['a] double_link x = object (self)
- inherit ['a] link x
- val mutable prev = None
- method prev = prev
- method set_next l =
- next <- l;
- match l with Some l -> l#set_prev (Some self) | None -> ()
- method set_prev l = prev <- l
- end;;
-Warning 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.
-# #
- 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
- method equals = acc -. arg
- end;;
-Warning 7: the method enter is overridden.
-#
- 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
- method equals = acc -. arg
- end;;
-
-Warning 7: the method equals is overridden.
-#
- 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
- method equals = acc -. arg
- end;;
-
-
-Warning 7: the method enter is overridden.
-#
- 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
- method equals = acc -. arg
- end;;
-
-
-
-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
-# # class e () = object inherit c () inherit d () end;;
-Warning 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
# # class c () = object val x = - true val y = -. () end;;
Error: 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
-# # class e () = object
- method f = 3
- inherit c ()
- method g = 3
- method i = 3
- inherit d ()
- method j = 3
- end;;
-Warning 7: the following methods are overriden by the class c :
- f
-# class e () = object
- method f = 3
- inherit c ()
- method g = 3
- method i = 3
- inherit d ()
- method j = 3
- end;;
-
-
-Warning 7: the method g is overridden.
-# class e () = object
- method f = 3
- inherit c ()
- method g = 3
- method i = 3
- inherit d ()
- method j = 3
- end;;
-
-
-
-Warning 7: the following methods are overriden by the class d :
- h i
-# class e () = object
- method f = 3
- inherit c ()
- method g = 3
- method i = 3
- inherit d ()
- method j = 3
- end;;
-
-
-
-
-
-Warning 7: the method j is overridden.
-class e :
+# class e :
unit ->
object
method f : int