dom: return a more precise `Array[XMLTag]` as the doc already said
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 21 May 2017 15:54:21 +0000 (08:54 -0700)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 23 May 2017 11:31:20 +0000 (04:31 -0700)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/dom/dom.nit

index 786bdcc..8c4c08e 100644 (file)
@@ -30,9 +30,9 @@ redef class XMLEntity
        # assert xml["animal"].length == 1
        # assert xml["animal"].first["cat"].length == 2
        # ~~~
-       fun [](tag_name: String): Array[XMLEntity]
+       fun [](tag_name: String): Array[XMLTag]
        do
-               var res = new Array[XMLEntity]
+               var res = new Array[XMLTag]
                for child in children do
                        if child isa XMLTag and child.tag_name == tag_name then
                                res.add child