Any reason why you pass SPC around? I think it is better design to have a method in the trait that returns the current compiler instance. It is unlikely that we will have different compilers here.