[scala] refactor assignment rules