Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.jetbrains.jet.lang.diagnostics.Errors Maven / Gradle / Ivy
/*
* Copyright 2010-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.lang.diagnostics;
import com.google.common.collect.ImmutableSet;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.source.tree.LeafPsiElement;
import kotlin.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.*;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.calls.inference.InferenceErrorData;
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lang.types.JetType;
import org.jetbrains.jet.lexer.JetKeywordToken;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
import org.jetbrains.jet.lexer.JetTokens;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collection;
import java.util.List;
import static org.jetbrains.jet.lang.diagnostics.PositioningStrategies.*;
import static org.jetbrains.jet.lang.diagnostics.Severity.ERROR;
import static org.jetbrains.jet.lang.diagnostics.Severity.WARNING;
/**
* For error messages, see DefaultErrorMessages and IdeErrorMessages.
*/
public interface Errors {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Meta-errors: unsupported features, failure
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DiagnosticFactory1 UNSUPPORTED = DiagnosticFactory1.create(ERROR);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Generic errors/warnings: applicable in many contexts
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DiagnosticFactory1 REDECLARATION = DiagnosticFactory1.create(ERROR, FOR_REDECLARATION);
DiagnosticFactory1 UNRESOLVED_REFERENCE =
DiagnosticFactory1.create(ERROR, FOR_UNRESOLVED_REFERENCE);
//Elements with "INVISIBLE_REFERENCE" error are marked as unresolved, unlike elements with "INVISIBLE_MEMBER" error
//"INVISIBLE_REFERENCE" is used for invisible classes references and references in import
DiagnosticFactory3 INVISIBLE_REFERENCE =
DiagnosticFactory3.create(ERROR);
DiagnosticFactory3 INVISIBLE_MEMBER = DiagnosticFactory3.create(ERROR, CALL_ELEMENT);
DiagnosticFactory1> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Errors/warnings in types
// Note: class/trait declaration is NOT a type. A type is something that may be written on the right-hand side of ":"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DiagnosticFactory0 PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT = DiagnosticFactory0.create(ERROR, VARIANCE_IN_PROJECTION);
DiagnosticFactory2 UPPER_BOUND_VIOLATED = DiagnosticFactory2.create(ERROR);
DiagnosticFactory0 REDUNDANT_NULLABLE = DiagnosticFactory0.create(WARNING, NULLABLE_TYPE);
DiagnosticFactory1 BASE_WITH_NULLABLE_UPPER_BOUND = DiagnosticFactory1.create(WARNING, NULLABLE_TYPE);
DiagnosticFactory1 WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory2 NO_TYPE_ARGUMENTS_ON_RHS = DiagnosticFactory2.create(ERROR);
DiagnosticFactory1 CONFLICTING_PROJECTION = DiagnosticFactory1.create(ERROR, VARIANCE_IN_PROJECTION);
DiagnosticFactory1 REDUNDANT_PROJECTION = DiagnosticFactory1.create(WARNING, VARIANCE_IN_PROJECTION);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Errors in declarations
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Imports
DiagnosticFactory1 CANNOT_IMPORT_FROM_ELEMENT = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 CANNOT_BE_IMPORTED = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 USELESS_HIDDEN_IMPORT = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 USELESS_SIMPLE_IMPORT = DiagnosticFactory0.create(WARNING);
// Modifiers
DiagnosticFactory1> INCOMPATIBLE_MODIFIERS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 ILLEGAL_MODIFIER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory2 REDUNDANT_MODIFIER = DiagnosticFactory2.create(WARNING);
DiagnosticFactory0 INAPPLICABLE_ANNOTATION = DiagnosticFactory0.create(ERROR);
// Annotations
DiagnosticFactory0 SUPERTYPES_FOR_ANNOTATION_CLASS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 MISSING_VAL_ON_ANNOTATION_PARAMETER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ANNOTATION_CLASS_CONSTRUCTOR_CALL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 ANNOTATION_CLASS_WITH_BODY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 INVALID_TYPE_OF_ANNOTATION_MEMBER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NULLABLE_TYPE_OF_ANNOTATION_MEMBER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ILLEGAL_ANNOTATION_KEYWORD = DiagnosticFactory0
.create(ERROR, modifierSetPosition(JetTokens.ANNOTATION_KEYWORD));
DiagnosticFactory0 ANNOTATION_PARAMETER_MUST_BE_CONST = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ANNOTATION_PARAMETER_MUST_BE_CLASS_LITERAL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ANNOTATION_PARAMETER_MUST_BE_ENUM_CONST = DiagnosticFactory0.create(ERROR);
// Classes and traits
DiagnosticFactory0 PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE =
DiagnosticFactory0.create(ERROR, VARIANCE_IN_PROJECTION);
DiagnosticFactory0 CYCLIC_INHERITANCE_HIERARCHY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SUPERTYPE_NOT_INITIALIZED = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 DELEGATION_NOT_TO_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SUPERTYPE_NOT_A_CLASS_OR_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NO_GENERICS_IN_SUPERTYPE_SPECIFIER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 MANY_CLASSES_IN_SUPERTYPE_LIST = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SUPERTYPE_APPEARS_TWICE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory3>
INCONSISTENT_TYPE_PARAMETER_VALUES = DiagnosticFactory3.create(ERROR);
DiagnosticFactory0 FINAL_SUPERTYPE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SINGLETON_IN_SUPERTYPE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NULLABLE_SUPERTYPE = DiagnosticFactory0.create(ERROR, NULLABLE_TYPE);
// Trait-specific
DiagnosticFactory0 ABSTRACT_MODIFIER_IN_TRAIT = DiagnosticFactory0
.create(WARNING, ABSTRACT_MODIFIER);
DiagnosticFactory0 OPEN_MODIFIER_IN_TRAIT = DiagnosticFactory0
.create(WARNING, modifierSetPosition(JetTokens.OPEN_KEYWORD));
DiagnosticFactory0 TRAIT_CAN_NOT_BE_FINAL = DiagnosticFactory0.create(ERROR, FINAL_MODIFIER);
DiagnosticFactory0 CONSTRUCTOR_IN_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SUPERTYPE_INITIALIZED_IN_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 DELEGATION_IN_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2 UNMET_TRAIT_REQUIREMENT =
DiagnosticFactory2.create(ERROR, PositioningStrategies.DECLARATION_NAME);
// Enum-specific
DiagnosticFactory0 ILLEGAL_ENUM_ANNOTATION = DiagnosticFactory0
.create(ERROR, modifierSetPosition(JetTokens.ENUM_KEYWORD));
DiagnosticFactory0 OPEN_MODIFIER_IN_ENUM = DiagnosticFactory0
.create(ERROR, modifierSetPosition(JetTokens.OPEN_KEYWORD));
DiagnosticFactory0 ABSTRACT_MODIFIER_IN_ENUM = DiagnosticFactory0
.create(ERROR, modifierSetPosition(JetTokens.ABSTRACT_KEYWORD));
DiagnosticFactory0 CLASS_IN_SUPERTYPE_FOR_ENUM = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 TYPE_PARAMETERS_IN_ENUM = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
DiagnosticFactory1 ENUM_ENTRY_ILLEGAL_TYPE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 LOCAL_ENUM_NOT_ALLOWED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
// Class objects
DiagnosticFactory0 MANY_CLASS_OBJECTS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 CLASS_OBJECT_NOT_ALLOWED = DiagnosticFactory0.create(ERROR);
// Objects
DiagnosticFactory1 LOCAL_OBJECT_NOT_ALLOWED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
// Type parameter declarations
DiagnosticFactory1 FINAL_UPPER_BOUND = DiagnosticFactory1.create(WARNING);
DiagnosticFactory1 FINAL_CLASS_OBJECT_UPPER_BOUND = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 CONFLICTING_UPPER_BOUNDS =
DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
DiagnosticFactory1 CONFLICTING_CLASS_OBJECT_UPPER_BOUNDS
= DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
DiagnosticFactory2 NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER =
DiagnosticFactory2.create(ERROR);
DiagnosticFactory0
VARIANCE_ON_TYPE_PARAMETER_OF_FUNCTION_OR_PROPERTY = DiagnosticFactory0.create(ERROR, VARIANCE_MODIFIER);
// Members
DiagnosticFactory0 PACKAGE_MEMBER_CANNOT_BE_PROTECTED =
DiagnosticFactory0.create(ERROR, modifierSetPosition(JetTokens.PROTECTED_KEYWORD));
DiagnosticFactory0 PUBLIC_MEMBER_SHOULD_SPECIFY_TYPE = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory2 CONFLICTING_OVERLOADS =
DiagnosticFactory2.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
DiagnosticFactory1 ILLEGAL_PLATFORM_NAME = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 NON_FINAL_MEMBER_IN_FINAL_CLASS = DiagnosticFactory0.create(WARNING, modifierSetPosition(
JetTokens.OPEN_KEYWORD));
DiagnosticFactory1 NOTHING_TO_OVERRIDE = DiagnosticFactory1.create(ERROR, OVERRIDE_MODIFIER);
DiagnosticFactory3 VIRTUAL_MEMBER_HIDDEN =
DiagnosticFactory3.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory2 CANNOT_OVERRIDE_INVISIBLE_MEMBER =
DiagnosticFactory2.create(ERROR, OVERRIDE_MODIFIER);
DiagnosticFactory2 DATA_CLASS_OVERRIDE_CONFLICT =
DiagnosticFactory2.create(ERROR);
DiagnosticFactory1 CANNOT_INFER_VISIBILITY =
DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
DiagnosticFactory2 OVERRIDING_FINAL_MEMBER =
DiagnosticFactory2.create(ERROR, OVERRIDE_MODIFIER);
DiagnosticFactory3 CANNOT_WEAKEN_ACCESS_PRIVILEGE =
DiagnosticFactory3.create(ERROR, VISIBILITY_MODIFIER);
DiagnosticFactory3 CANNOT_CHANGE_ACCESS_PRIVILEGE =
DiagnosticFactory3.create(ERROR, VISIBILITY_MODIFIER);
DiagnosticFactory2 RETURN_TYPE_MISMATCH_ON_OVERRIDE =
DiagnosticFactory2.create(ERROR, DECLARATION_RETURN_TYPE);
DiagnosticFactory2 PROPERTY_TYPE_MISMATCH_ON_OVERRIDE =
DiagnosticFactory2.create(ERROR, DECLARATION_RETURN_TYPE);
DiagnosticFactory2 ABSTRACT_MEMBER_NOT_IMPLEMENTED =
DiagnosticFactory2.create(ERROR, DECLARATION_NAME);
DiagnosticFactory2 MANY_IMPL_MEMBER_NOT_IMPLEMENTED =
DiagnosticFactory2.create(ERROR, DECLARATION_NAME);
DiagnosticFactory1> AMBIGUOUS_ANONYMOUS_TYPE_INFERRED =
DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE);
// Property-specific
DiagnosticFactory2 VAR_OVERRIDDEN_BY_VAL =
DiagnosticFactory2.create(ERROR, VAL_OR_VAR_NODE);
DiagnosticFactory0 REDUNDANT_MODIFIER_IN_GETTER = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 GETTER_VISIBILITY_DIFFERS_FROM_PROPERTY_VISIBILITY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2 WRONG_GETTER_RETURN_TYPE = DiagnosticFactory2.create(ERROR);
DiagnosticFactory0
ABSTRACT_PROPERTY_IN_PRIMARY_CONSTRUCTOR_PARAMETERS = DiagnosticFactory0.create(ERROR, ABSTRACT_MODIFIER);
DiagnosticFactory0 ABSTRACT_PROPERTY_WITH_INITIALIZER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ABSTRACT_PROPERTY_WITH_GETTER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ABSTRACT_PROPERTY_WITH_SETTER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ABSTRACT_DELEGATED_PROPERTY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ACCESSOR_FOR_DELEGATED_PROPERTY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 DELEGATED_PROPERTY_IN_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 LOCAL_VARIABLE_WITH_DELEGATE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 PROPERTY_WITH_NO_TYPE_NO_INITIALIZER = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory0 MUST_BE_INITIALIZED = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory0 MUST_BE_INITIALIZED_OR_BE_ABSTRACT = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory0 EXTENSION_PROPERTY_WITH_BACKING_FIELD = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 PROPERTY_INITIALIZER_NO_BACKING_FIELD = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 PROPERTY_INITIALIZER_IN_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 FINAL_PROPERTY_IN_TRAIT = DiagnosticFactory0.create(ERROR, FINAL_MODIFIER);
DiagnosticFactory0 BACKING_FIELD_IN_TRAIT = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory2 ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS = DiagnosticFactory2.create(ERROR, ABSTRACT_MODIFIER);
DiagnosticFactory0 VAL_WITH_SETTER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SETTER_PARAMETER_WITH_DEFAULT_VALUE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2 WRONG_SETTER_PARAMETER_TYPE = DiagnosticFactory2.create(ERROR);
// Function-specific
DiagnosticFactory2 ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS = DiagnosticFactory2.create(ERROR, ABSTRACT_MODIFIER);
DiagnosticFactory1 ABSTRACT_FUNCTION_WITH_BODY = DiagnosticFactory1.create(ERROR, ABSTRACT_MODIFIER);
DiagnosticFactory1 NON_ABSTRACT_FUNCTION_WITH_NO_BODY =
DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory1 FINAL_FUNCTION_WITH_NO_BODY = DiagnosticFactory1.create(ERROR, FINAL_MODIFIER);
DiagnosticFactory1 NON_MEMBER_FUNCTION_NO_BODY =
DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory0 VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NO_TAIL_CALLS_FOUND = DiagnosticFactory0.create(WARNING, DECLARATION_SIGNATURE);
// Named parameters
DiagnosticFactory0 DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE = DiagnosticFactory0.create(ERROR, PARAMETER_DEFAULT_VALUE);
DiagnosticFactory1 MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_WHEN_NO_EXPLICIT_OVERRIDE =
DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
DiagnosticFactory2 PARAMETER_NAME_CHANGED_ON_OVERRIDE =
DiagnosticFactory2.create(WARNING, DECLARATION_NAME);
DiagnosticFactory2, Integer> DIFFERENT_NAMES_FOR_THE_SAME_PARAMETER_IN_SUPERTYPES =
DiagnosticFactory2.create(WARNING, DECLARATION_NAME);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Errors/warnings inside code blocks
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// General
DiagnosticFactory1 NAME_SHADOWING = DiagnosticFactory1.create(WARNING, PositioningStrategies.FOR_REDECLARATION);
DiagnosticFactory0 TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM = DiagnosticFactory0.create(ERROR);
// Checking call arguments
DiagnosticFactory0 MIXING_NAMED_AND_POSITIONED_ARGUMENTS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ARGUMENT_PASSED_TWICE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 NAMED_PARAMETER_NOT_FOUND =
DiagnosticFactory1.create(ERROR, FOR_UNRESOLVED_REFERENCE);
DiagnosticFactory0 NAMED_ARGUMENTS_NOT_ALLOWED = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 VARARG_OUTSIDE_PARENTHESES = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NON_VARARG_SPREAD = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 MANY_FUNCTION_LITERAL_ARGUMENTS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 TOO_MANY_ARGUMENTS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 NO_VALUE_FOR_PARAMETER = DiagnosticFactory1.create(ERROR, VALUE_ARGUMENTS);
DiagnosticFactory1 MISSING_RECEIVER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 NO_RECEIVER_ALLOWED = DiagnosticFactory0.create(ERROR);
// Call resolution
DiagnosticFactory1 ILLEGAL_SELECTOR = DiagnosticFactory1.create(ERROR);
DiagnosticFactory2 FUNCTION_EXPECTED = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2 FUNCTION_CALL_EXPECTED = DiagnosticFactory2.create(ERROR, CALL_EXPRESSION);
DiagnosticFactory0 NON_TAIL_RECURSIVE_CALL = DiagnosticFactory0.create(WARNING, CALL_EXPRESSION);
DiagnosticFactory0 TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED = DiagnosticFactory0.create(WARNING, CALL_EXPRESSION);
DiagnosticFactory0 NO_CONSTRUCTOR = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NOT_A_CLASS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1>> OVERLOAD_RESOLUTION_AMBIGUITY = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1>> NONE_APPLICABLE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1>> CANNOT_COMPLETE_RESOLVE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1>> UNRESOLVED_REFERENCE_WRONG_RECEIVER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED = DiagnosticFactory0.create(WARNING);
DiagnosticFactory1 TYPE_PARAMETER_AS_REIFIED = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 REIFIED_TYPE_PARAMETER_NO_INLINE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 REIFIED_TYPE_NOTHING_SUBSTITUTION = DiagnosticFactory1.create(ERROR);
// Type inference
DiagnosticFactory0 CANNOT_INFER_PARAMETER_TYPE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 TYPE_INFERENCE_UPPER_BOUND_VIOLATED = DiagnosticFactory1.create(ERROR);
DiagnosticFactory2 TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH = DiagnosticFactory2.create(ERROR);
// Reflection
DiagnosticFactory0 REFLECTION_TYPES_NOT_LOADED = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 CALLABLE_REFERENCE_LHS_NOT_A_CLASS = DiagnosticFactory0.create(ERROR);
// Multi-declarations
DiagnosticFactory0 INITIALIZER_REQUIRED_FOR_MULTIDECLARATION = DiagnosticFactory0.create(ERROR, DEFAULT);
DiagnosticFactory2 COMPONENT_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR, DEFAULT);
DiagnosticFactory2>> COMPONENT_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR, DEFAULT);
DiagnosticFactory3 COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR, DEFAULT);
// Super calls
DiagnosticFactory1 SUPER_IS_NOT_AN_EXPRESSION = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 SUPER_NOT_AVAILABLE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 SUPERCLASS_NOT_ACCESSIBLE_FROM_TRAIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 AMBIGUOUS_SUPER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 ABSTRACT_SUPER_CALL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 NOT_A_SUPERTYPE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 TYPE_ARGUMENTS_REDUNDANT_IN_SUPER_QUALIFIER = DiagnosticFactory0.create(WARNING);
// Conventions
DiagnosticFactory0 NO_GET_METHOD = DiagnosticFactory0.create(ERROR, ARRAY_ACCESS);
DiagnosticFactory0 NO_SET_METHOD = DiagnosticFactory0.create(ERROR, ARRAY_ACCESS);
DiagnosticFactory0 INC_DEC_SHOULD_NOT_RETURN_UNIT = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2 ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT =
DiagnosticFactory2.create(ERROR);
DiagnosticFactory1>>
ASSIGN_OPERATOR_AMBIGUITY = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 EQUALS_MISSING = DiagnosticFactory0.create(ERROR);
DiagnosticFactory3 EQUALITY_NOT_APPLICABLE =
DiagnosticFactory3.create(ERROR);
DiagnosticFactory1 HAS_NEXT_MISSING = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 HAS_NEXT_FUNCTION_AMBIGUITY = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 HAS_NEXT_FUNCTION_NONE_APPLICABLE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 HAS_NEXT_FUNCTION_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 NEXT_AMBIGUITY = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 NEXT_MISSING = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 NEXT_NONE_APPLICABLE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 ITERATOR_MISSING = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1>> ITERATOR_AMBIGUITY = DiagnosticFactory1.create(ERROR);
DiagnosticFactory2 DELEGATE_SPECIAL_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2>> DELEGATE_SPECIAL_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2>> DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE = DiagnosticFactory2.create(ERROR);
DiagnosticFactory3 DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR);
DiagnosticFactory2>> DELEGATE_PD_METHOD_NONE_APPLICABLE = DiagnosticFactory2.create(WARNING);
DiagnosticFactory1 COMPARE_TO_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR);
// Labels
DiagnosticFactory0 LABEL_NAME_CLASH = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 AMBIGUOUS_LABEL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 BREAK_OR_CONTINUE_OUTSIDE_A_LOOP = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 NOT_A_LOOP_LABEL = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 NOT_A_RETURN_LABEL = DiagnosticFactory1.create(ERROR);
// Control flow / Data flow
DiagnosticFactory1> UNREACHABLE_CODE = DiagnosticFactory1.create(
WARNING, PositioningStrategies.markTextRangesFromDiagnostic(new Function1>() {
@Override
public List invoke(Diagnostic diagnostic) {
return UNREACHABLE_CODE.cast(diagnostic).getA();
}
}));
DiagnosticFactory0 VARIABLE_WITH_NO_TYPE_NO_INITIALIZER = DiagnosticFactory0.create(ERROR, DECLARATION_NAME);
DiagnosticFactory1 UNINITIALIZED_VARIABLE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 UNINITIALIZED_PARAMETER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 UNUSED_VARIABLE = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
DiagnosticFactory1 UNUSED_PARAMETER = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
DiagnosticFactory1 ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE =
DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
DiagnosticFactory1 VARIABLE_WITH_REDUNDANT_INITIALIZER = DiagnosticFactory1.create(WARNING);
DiagnosticFactory2 UNUSED_VALUE = DiagnosticFactory2.create(WARNING);
DiagnosticFactory1 UNUSED_CHANGED_VALUE = DiagnosticFactory1.create(WARNING);
DiagnosticFactory0 UNUSED_EXPRESSION = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 UNUSED_FUNCTION_LITERAL = DiagnosticFactory0.create(WARNING);
DiagnosticFactory1 VAL_REASSIGNMENT = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 SETTER_PROJECTED_OUT = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 INITIALIZATION_BEFORE_DECLARATION = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 VARIABLE_EXPECTED = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2 SENSELESS_COMPARISON = DiagnosticFactory2.create(WARNING);
DiagnosticFactory0 SENSELESS_NULL_IN_WHEN = DiagnosticFactory0.create(WARNING);
// Nullability
DiagnosticFactory1 UNSAFE_CALL = DiagnosticFactory1.create(ERROR);
DiagnosticFactory3 UNSAFE_INFIX_CALL = DiagnosticFactory3.create(ERROR);
DiagnosticFactory1 UNNECESSARY_SAFE_CALL = DiagnosticFactory1.create(WARNING);
DiagnosticFactory1 UNNECESSARY_NOT_NULL_ASSERTION = DiagnosticFactory1.create(WARNING);
DiagnosticFactory1 USELESS_ELVIS = DiagnosticFactory1.create(WARNING);
// Compile-time values
DiagnosticFactory0 INTEGER_OVERFLOW = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 WRONG_LONG_SUFFIX = DiagnosticFactory0.create(ERROR, LONG_LITERAL_SUFFIX);
DiagnosticFactory0 INT_LITERAL_OUT_OF_RANGE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 FLOAT_LITERAL_OUT_OF_RANGE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2 CONSTANT_EXPECTED_TYPE_MISMATCH = DiagnosticFactory2.create(ERROR);
DiagnosticFactory0 INCORRECT_CHARACTER_LITERAL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 EMPTY_CHARACTER_LITERAL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1 TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 ILLEGAL_ESCAPE = DiagnosticFactory1.create(ERROR, CUT_CHAR_QUOTES);
DiagnosticFactory1 NULL_FOR_NONNULL_TYPE = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 ILLEGAL_ESCAPE_SEQUENCE = DiagnosticFactory0.create(ERROR);
// Casts and is-checks
DiagnosticFactory1 CANNOT_CHECK_FOR_ERASED = DiagnosticFactory1.create(ERROR);
DiagnosticFactory2 UNCHECKED_CAST = DiagnosticFactory2.create(WARNING);
DiagnosticFactory0 USELESS_CAST_STATIC_ASSERT_IS_FINE = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 USELESS_CAST = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0 CAST_NEVER_SUCCEEDS = DiagnosticFactory0.create(WARNING);
DiagnosticFactory1 IMPLICIT_CAST_TO_UNIT_OR_ANY = DiagnosticFactory1.create(WARNING);
DiagnosticFactory2 SMARTCAST_IMPOSSIBLE = DiagnosticFactory2.create(ERROR);
DiagnosticFactory0 USELESS_NULLABLE_CHECK = DiagnosticFactory0.create(WARNING, NULLABLE_TYPE);
// Properties / locals
DiagnosticFactory1 INITIALIZATION_USING_BACKING_FIELD_CUSTOM_SETTER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1 INITIALIZATION_USING_BACKING_FIELD_OPEN_SETTER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0 LOCAL_EXTENSION_PROPERTY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 LOCAL_VARIABLE_WITH_GETTER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0 LOCAL_VARIABLE_WITH_SETTER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory3 INVISIBLE_SETTER = DiagnosticFactory3.create(ERROR);
DiagnosticFactory1 VAL_OR_VAR_ON_LOOP_PARAMETER = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1