Beispiel #1
0
public interface ErrorsJs {
  DiagnosticFactory1<KtElement, KotlinType>
      NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN =
          DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
  DiagnosticFactory1<KtElement, String> NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER =
      DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
  DiagnosticFactory1<KtElement, String> NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS =
      DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
  DiagnosticFactory0<KtDeclaration> NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE =
      DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE);
  DiagnosticFactory0<KtDeclaration> NATIVE_SETTER_WRONG_RETURN_TYPE =
      DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE);
  DiagnosticFactory2<KtElement, Integer, String> NATIVE_INDEXER_WRONG_PARAMETER_COUNT =
      DiagnosticFactory2.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
  DiagnosticFactory1<KtExpression, JsCallData> JSCODE_ERROR =
      DiagnosticFactory1.create(ERROR, JsCodePositioningStrategy.INSTANCE);
  DiagnosticFactory1<KtExpression, JsCallData> JSCODE_WARNING =
      DiagnosticFactory1.create(WARNING, JsCodePositioningStrategy.INSTANCE);
  DiagnosticFactory0<KtExpression> JSCODE_ARGUMENT_SHOULD_BE_CONSTANT =
      DiagnosticFactory0.create(ERROR, DEFAULT);
  DiagnosticFactory1<KtElement, KtElement> NOT_SUPPORTED =
      DiagnosticFactory1.create(ERROR, DEFAULT);
  DiagnosticFactory1<KtElement, KtElement> REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED =
      DiagnosticFactory1.create(ERROR, DEFAULT);
  DiagnosticFactory1<KtNamedDeclaration, String> NON_TOPLEVEL_CLASS_DECLARATION =
      DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
  DiagnosticFactory0<KtExpression> JSCODE_NO_JAVASCRIPT_PRODUCED =
      DiagnosticFactory0.create(ERROR, DEFAULT);

  @SuppressWarnings("UnusedDeclaration")
  Object _initializer =
      new Object() {
        {
          Errors.Initializer.initializeFactoryNames(ErrorsJs.class);
        }
      };
}
Beispiel #2
0
public interface ErrorsJvm {
  DiagnosticFactory1<PsiElement, ConflictingJvmDeclarationsData> CONFLICTING_JVM_DECLARATIONS =
      DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);

  DiagnosticFactory1<PsiElement, ConflictingJvmDeclarationsData> ACCIDENTAL_OVERRIDE =
      DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);

  DiagnosticFactory0<JetDeclaration> OVERRIDE_CANNOT_BE_STATIC =
      DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
  DiagnosticFactory0<JetDeclaration> PLATFORM_STATIC_NOT_IN_OBJECT =
      DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
  DiagnosticFactory1<JetDeclaration, DeclarationDescriptor> PLATFORM_STATIC_ILLEGAL_USAGE =
      DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE);

  DiagnosticFactory0<JetDeclaration> OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS =
      DiagnosticFactory0.create(WARNING, DECLARATION_SIGNATURE);
  DiagnosticFactory0<JetDeclaration> OVERLOADS_ABSTRACT =
      DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
  DiagnosticFactory0<JetDeclaration> OVERLOADS_PRIVATE =
      DiagnosticFactory0.create(WARNING, DECLARATION_SIGNATURE);

  DiagnosticFactory0<JetDeclaration> NATIVE_DECLARATION_CANNOT_BE_ABSTRACT =
      DiagnosticFactory0.create(ERROR, ABSTRACT_MODIFIER);
  DiagnosticFactory0<JetDeclaration> NATIVE_DECLARATION_CANNOT_HAVE_BODY =
      DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
  DiagnosticFactory0<JetDeclaration> NATIVE_DECLARATION_IN_TRAIT =
      DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
  DiagnosticFactory0<JetDeclaration> NATIVE_DECLARATION_CANNOT_BE_INLINED =
      DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);

  DiagnosticFactory0<JetExpression> POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION =
      DiagnosticFactory0.create(ERROR);
  DiagnosticFactory0<JetElement> DEPRECATED_ANNOTATION_METHOD_CALL =
      DiagnosticFactory0.create(WARNING);

  DiagnosticFactory0<JetElement> TRAIT_CANT_CALL_DEFAULT_METHOD_VIA_SUPER =
      DiagnosticFactory0.create(ERROR);

  // TODO: make this a warning
  DiagnosticFactory1<JetExpression, JetExpression> NO_REFLECTION_IN_CLASS_PATH =
      DiagnosticFactory1.create(ERROR);

  enum NullabilityInformationSource {
    KOTLIN {
      @NotNull
      @Override
      public String toString() {
        return "Kotlin";
      }
    },
    JAVA {
      @NotNull
      @Override
      public String toString() {
        return "Java";
      }
    };
  }

  DiagnosticFactory2<JetElement, NullabilityInformationSource, NullabilityInformationSource>
      NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS = DiagnosticFactory2.create(WARNING);

  DiagnosticFactory0<JetExpression> WHEN_ENUM_CAN_BE_NULL_IN_JAVA =
      DiagnosticFactory0.create(WARNING);

  @SuppressWarnings("UnusedDeclaration")
  Object _initializer =
      new Object() {
        {
          Errors.Initializer.initializeFactoryNames(ErrorsJvm.class);
        }
      };
}