In the MWE below
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \i in {0, 1, 2, 3}
\draw (\i, 0) rectangle +(0.5, 0.5);
% \draw (\i, 1) rectangle +(0.5, 0.5);
% Error if above line is uncommented:
% ! Undefined control sequence.
% \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@
\end{tikzpicture}
\end{document}
the file compiles as is with pdflatex but gives an error as noted in MWE if the commented line is uncommented.
I know I am doing something silly, but being an occasional user of TikZ, I am unsure what it is. Grateful for an explanation.