@NotNull public JetType getFunctionType( @NotNull Annotations annotations, @Nullable JetType receiverType, @NotNull List<JetType> parameterTypes, @NotNull JetType returnType) { List<TypeProjection> arguments = getFunctionTypeArgumentProjections(receiverType, parameterTypes, returnType); int size = parameterTypes.size(); ClassDescriptor classDescriptor = receiverType == null ? getFunction(size) : getExtensionFunction(size); TypeConstructor constructor = classDescriptor.getTypeConstructor(); return new JetTypeImpl( annotations, constructor, false, arguments, classDescriptor.getMemberScope(arguments)); }
@Nullable private static ClassDescriptor getEnumEntry( @NotNull ClassDescriptor enumDescriptor, @NotNull String entryName) { ClassifierDescriptor result = enumDescriptor .getUnsubstitutedInnerClassesScope() .getContributedClassifier(Name.identifier(entryName), NoLookupLocation.FROM_BUILTINS); return result instanceof ClassDescriptor ? (ClassDescriptor) result : null; }