private void resolveUpperBoundsFromWhereClause(Set<JetType> upperBounds) { JetClassOrObject classOrObject = JetStubbedPsiUtil.getPsiOrStubParent(jetTypeParameter, JetClassOrObject.class, true); if (classOrObject instanceof JetClass) { JetClass jetClass = (JetClass) classOrObject; for (JetTypeConstraint jetTypeConstraint : jetClass.getTypeConstraints()) { DescriptorResolver.reportUnsupportedClassObjectConstraint( resolveSession.getTrace(), jetTypeConstraint); JetSimpleNameExpression constrainedParameterName = jetTypeConstraint.getSubjectTypeParameterName(); if (constrainedParameterName != null) { if (getName().equals(constrainedParameterName.getReferencedNameAsName())) { resolveSession .getTrace() .record(BindingContext.REFERENCE_TARGET, constrainedParameterName, this); JetTypeReference boundTypeReference = jetTypeConstraint.getBoundTypeReference(); if (boundTypeReference != null) { JetType boundType = resolveBoundType(boundTypeReference); if (!jetTypeConstraint.isClassObjectConstraint()) { upperBounds.add(boundType); } } } } } } }