This is related to the question posted on SalesforceSE: https://salesforce.stackexchange.com/questions/226922/downcasting-failing-in-custom-apex-classes
I got curious with one of the answer suggested and wanted to try so updated Term_Segment__c refence to Contact object.
When I am trying this code, it shows error on line numbers 12,13, & 14 in ContactObject class.
Please see this video:
Update:
Was able to get rid of the above errors by downcasting to Contact object but it still shows error when downcasting object of instance SubscribeObject to ContactObject.
Please refer to this video: https://vimeo.com/282194861