ParticleSystem collidesWith

I am trying to change collidesWith paramater of an particle system inside of a script but i am getting this error:

Error CS1612 Cannot modify the return
value of ‘ParticleSystem.collision’
because it is not a variable

My Code:

GameObject ammo; //Game object with ParticleSystem on it
public LayerMask desiredLayers; 

private void Start()
{
    ammo.GetComponent<ParticleSystem>().collision.collidesWith = desiredLayers;
}

Now my question is what is the correct way to change the layers of a particle system collide with.

@richardkettlewell I asked this question because, on the official docs, there is no information about my question.
But anyway I figure out what was the problem:

Unity has something special for ParticleSystem which uses Pointers so following code solved my problem:

var collision = ammo.GetComponent<ParticleSystem>().collision;
collision .collidesWith = desiredLayers;