core/text: remove call on nullable warnings
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 15 Oct 2015 21:35:17 +0000 (17:35 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 15 Oct 2015 21:35:17 +0000 (17:35 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/core/text/flat.nit

index e8a2d4f..6cf1584 100644 (file)
@@ -1148,8 +1148,9 @@ redef class Array[E]
        do
                var l = length
                if l == 0 then return ""
-               if l == 1 then if self[0] == null then return "" else return self[0].to_s
-               var its = _items
+               var its = _items.as(not null)
+               var first = its[0]
+               if l == 1 then if first == null then return "" else return first.to_s
                var na = new NativeArray[String](l)
                var i = 0
                var sl = 0