public ErrorClassDescriptor(@Nullable String name) {
      super(
          getErrorModule(),
          Name.special(name == null ? "<ERROR CLASS>" : "<ERROR CLASS: " + name + ">"),
          Modality.OPEN,
          Collections.<JetType>emptyList(),
          SourceElement.NO_SOURCE);

      ConstructorDescriptorImpl errorConstructor =
          ConstructorDescriptorImpl.create(this, Annotations.EMPTY, true, SourceElement.NO_SOURCE);
      errorConstructor.initialize(
          Collections.<TypeParameterDescriptor>emptyList(),
          Collections.<ValueParameterDescriptor>emptyList(),
          Visibilities.INTERNAL);
      JetScope memberScope = createErrorScope(getName().asString());
      errorConstructor.setReturnType(
          new ErrorTypeImpl(
              TypeConstructorImpl.createForClass(
                  this,
                  Annotations.EMPTY,
                  false,
                  getName().asString(),
                  Collections.<TypeParameterDescriptorImpl>emptyList(),
                  Collections.singleton(KotlinBuiltIns.getInstance().getAnyType())),
              memberScope));

      initialize(
          memberScope,
          Collections.<ConstructorDescriptor>singleton(errorConstructor),
          errorConstructor);
    }
 @NotNull
 private static TypeConstructor createErrorTypeConstructorWithCustomDebugName(
     @NotNull String debugName) {
   return TypeConstructorImpl.createForClass(
       ERROR_CLASS,
       Annotations.EMPTY,
       false,
       debugName,
       Collections.<TypeParameterDescriptorImpl>emptyList(),
       Collections.singleton(KotlinBuiltIns.getInstance().getAnyType()));
 }
 public void createTypeConstructor() {
   assert typeConstructor == null : typeConstructor;
   this.typeConstructor =
       TypeConstructorImpl.createForClass(
           this,
           Annotations.EMPTY, // TODO : pass annotations from the class?
           !getModality().isOverridable(),
           getName().asString(),
           typeParameters,
           supertypes);
   for (FunctionDescriptor functionDescriptor : getConstructors()) {
     ((ConstructorDescriptorImpl) functionDescriptor).setReturnType(getDefaultType());
   }
   scopeForMemberResolution.setImplicitReceiver(getThisAsReceiverParameter());
 }