From: Alexis Laferrière Date: Sun, 21 May 2017 15:54:21 +0000 (-0700) Subject: dom: return a more precise `Array[XMLTag]` as the doc already said X-Git-Url: http://nitlanguage.org dom: return a more precise `Array[XMLTag]` as the doc already said Signed-off-by: Alexis Laferrière --- diff --git a/lib/dom/dom.nit b/lib/dom/dom.nit index 786bdcc..8c4c08e 100644 --- a/lib/dom/dom.nit +++ b/lib/dom/dom.nit @@ -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