They weren't but Hitler ignored the rule and no one did anything about it as no one wanted to go to war over it, I think he called them battle cruisers but added armour plate unlike the UK who built the Hood without armour plate in the right places. He also ignored the rule about an airforce as well and experimented the Blitzkreig in the Spanish civil war. Putin has based his ambitions in Ukraine using the same theory, so far they are partially working though the west is discovering if their new weapons are effective in Ukraine hands without actually threatening to desist.