[scala] implement type rules for forward references