Add test for casting through type application