Don't know what to title it, but here's what I have.

![enter image description here](https://i.stack.imgur.com/Cg4Dq.png)

As you can see I have following lines of code where 1st and 2nd lines are okay but third line is causing error.

Can someone explain why? I have a feeling that it might be because `(s is PaymentSchdule)` needs to be evaluated at runtime, is that the reason?