예제 #1
0
 public void checkParameterHasNoValOrVar(
     @NotNull JetParameter parameter,
     @NotNull DiagnosticFactory1<PsiElement, JetKeywordToken> diagnosticFactory) {
   PsiElement valOrVar = parameter.getValOrVarKeyword();
   if (valOrVar != null) {
     trace.report(
         diagnosticFactory.on(
             valOrVar, ((JetKeywordToken) valOrVar.getNode().getElementType())));
   }
 }
예제 #2
0
 private void checkNestedClassAllowed(
     @NotNull JetModifierListOwner modifierListOwner,
     @NotNull DeclarationDescriptor descriptor) {
   if (modifierListOwner.hasModifier(INNER_KEYWORD)) return;
   if (modifierListOwner instanceof JetClass && !(modifierListOwner instanceof JetEnumEntry)) {
     JetClass aClass = (JetClass) modifierListOwner;
     boolean localEnumError = aClass.isLocal() && aClass.isEnum();
     if (!localEnumError && isIllegalNestedClass(descriptor)) {
       trace.report(NESTED_CLASS_NOT_ALLOWED.on(aClass));
     }
   }
 }
예제 #3
0
 private void runDeclarationCheckers(
     @NotNull JetDeclaration declaration, @NotNull DeclarationDescriptor descriptor) {
   for (DeclarationChecker checker : declarationCheckers) {
     checker.check(declaration, descriptor, trace, trace.getBindingContext());
   }
 }