You don't need to make cast here.
At first we always did type inference.
And since recently Spec includes type promotion, so that "object" actually has type StringSource in "then" here.