Fix Issue 7472 - Cast from class to basic type not rejected during semantic
Merge pull request #2886 from yebblies/issue7472

Issue 7472 - Cast from class to basic type not rejected during semantic