Verification of upcasting (allowed) and downcasting (not allowed) in plug connections