Fix upcast with 'as' operator

Imagine: ```instance as SomeClass```

The check in TypeCheckVisitor would only check if `SomeClass` inherits the
class of `instance` but not the other way arround. This MR fixes the issue and adds test-cases.