I've been making my own list class that is generic and uses a variety of optimized methods. Unfortunately, though, I now get "invalid integer expression" errors at 5+ locations and cannot test the unit. Worse, these errors are ... inane.

These are all integer operations that work, yet generated errors. See for yourself.

Line 87 Column 9:
Code:
  B := -1;  // -1 is within the integer range I'm familiar with!
Line 116 Column 14:
Code:
  if idx <> -1 then
Line 127 Column 14:
Code:
  if idx <> -1 then
Line 194 Column 12:
Code:
  Find &#58;= -1; // assignment to "result"
Line 235 Column 11:
Code:
  if F = -1 then Exit;
Have I done something particularly crash-worthy? The source code (11kb) is under MPL.

Compiler options of note:
Dialect = Object Pascal (FPC)
Optimization = Faster Code