defining a new pgf class fails

I want to use the pgf oo library to create a new class. Unfortunately, even this fails:

\documentclass{article}

\usepackage{tikz}
\usepgfmodule{oo}

\pgfooclass{mapEntry}{ %
\method mapEntry() {%
}
}

\begin{document}
\pgfoonew \myObj = new mapEntry()
\end{document}

This is the error message I get:

Runaway argument?
\myObj = new mapEntry() \end {document}
! File ended while scanning use of \pgfoo@new.
<inserted text>
\par

Why does it fail? I found literally nothing useful about this, apart from the tikz manual chapter on the oo library.

-

For some reason, having spaces around the = will break things (even though they are used in the manual). The following code compiles for me:

\documentclass{article}

\usepackage{tikz}
\usepgfmodule{oo}

\pgfooclass{mapEntry}{ %
\method mapEntry() {%
}
}

\begin{document}

\pgfoonew \myObj=new mapEntry()

\end{document}
-
The reason that there can't be a space after the equal sign is that \pgfoo@new is defined as \def\pgfoo@new#1=new #2(#3){...} (and \pgfoonew essentially only calls \pgf@new or a variant if there are arguments present). –  Caramdir Jul 21 '11 at 3:34
Just happened on this one - hadn't seen it before and wish I had since this took me ages to figure out! –  Loop Space Oct 4 '12 at 14:20