Urywki z kodu:
var
k: integer;
begin
k := round(radtodeg(arcsin(s)));
if y2 < y1 then
k := k + 2 * (90 - k);
if x2 < x1 then
k := k + 2 * (180 - k);
if (k in [0 .. 22]) or (k in [338 .. 360]) then
ustaw(x1, y1, Pionowa)
else if k in [22 .. 67] then
ustaw(x1, y1, WPrawo)
else if k in [67 .. 112] then
ustaw(x1, y1, Pozioma)
else if k in [112 .. 157] then
ustaw(x1, y1 - 1, WLewo)
else if k in [157 .. 202] then
ustaw(x1, y1 - 1, Pionowa)
else if k in [202 .. 247] then
ustaw(x1 - 1, y1 - 1, WPrawo)
else if k in [247 .. 292] then
ustaw(x1 - 1, y1, Pozioma)
else if k in [292 .. 337] then
ustaw(x1 - 1, y1, WLewo)
To wywołuje lawinę wargningów:
(118,48) Warning: range check error while evaluating constants
(118,41) Warning: range check error while evaluating constants
(130,32) Warning: range check error while evaluating constants
(132,32) Warning: range check error while evaluating constants
(132,25) Warning: range check error while evaluating constants
(131,13) Warning: unreachable code
Nie pojmuję ich kompletnie. Co to znaczy: range check error
?!? Przecież sprawdzałem kilka razy, zawsze po lewej stronie wstawiałem liczbę mniejszą, niż po prawej. Na przykład 0
jest mniejsze niż 22
a 292
jest mniejsze niż 337
.
Tym mniej pojmuję Warning: unreachable code
(odnosi się ono do przypadku else if k in [247 .. 292]
). No albo jestem kompletnie ślepy, albo naprawdę ten przypadek nie był nigdzie wcześniej pokryty!
Mógłbym prosić o pomoc przy interpretacji tych warningów? Z góry dzięki!