add directive validation at Compile() time