@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)); }