detect primitive call at ast construction time

(thanks Sam)