URL:
  <http://gna.org/bugs/?13261>

                 Summary: Runtime error when using [] on item that is not a
list or map
                 Project: Battle for Wesnoth
            Submitted by: seahen
            Submitted on: Thursday 03/26/09 at 05:49
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Artificial Intelligence
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 33557
        Operating System: all

    _______________________________________________________

Details:

In FormulaAI, attempting to access a nonexistent property of an object or
nonexistent element of a list or map returns (null)0, as does dividing by
zero or invoking a math operator with non-numeric inputs. This suggests the
general principle that nullness can always be used for error trapping.

But one exception is attempting to retrieve x[0] if x is neither a list nor a
map. Doing this causes a runtime error. I suspect this is a bug and should
instead return (null)0.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?13261>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to