Extended type-validation to validate also with instanceof and [] modifier