lib/a_star: avoid bad autocast
[nit.git] / lib / a_star.nit
index 2cbd7cf..9735d90 100644 (file)
@@ -147,7 +147,8 @@ class Node
 
                                while frontier_node != self do
                                        path.nodes.unshift(frontier_node)
-                                       frontier_node = frontier_node.best_source.as(not null)
+                                       frontier_node = frontier_node.best_source
+                                       assert frontier_node != null
                                end
 
                                return path