コード例 #1
0
    @Override
    public void visitEnumEntry(@NotNull JetEnumEntry declaration) {
      MutableClassDescriptor descriptor =
          createClassDescriptorForSingleton(
              declaration, JetPsiUtil.safeName(declaration.getName()), ClassKind.ENUM_ENTRY);

      owner.addClassifierDescriptor(descriptor);

      descriptor.getBuilder().setClassObjectDescriptor(createSyntheticClassObject(descriptor));
    }
コード例 #2
0
  @Override
  public void visitEnumEntry(JetEnumEntry enumEntry) {
    ClassDescriptor descriptor = bindingContext.get(CLASS, enumEntry);
    assert descriptor != null;

    final boolean trivial = enumEntry.getDeclarations().isEmpty();
    if (!trivial) {
      bindingTrace.record(ENUM_ENTRY_CLASS_NEED_SUBCLASS, descriptor);
      super.visitEnumEntry(enumEntry);
    } else {
      JvmClassName jvmClassName = bindingTrace.get(FQN, peekFromStack(classStack));
      assert PsiCodegenPredictor.checkPredictedNameFromPsi(bindingTrace, descriptor, jvmClassName);
      bindingTrace.record(FQN, descriptor, jvmClassName);
    }
  }