Ejemplo n.º 1
0
  private void processModifiersOnInitializer(
      @NotNull JetModifierListOwner owner, @NotNull LexicalScope scope) {
    annotationChecker.check(owner, trace, null);
    ModifierCheckerCore.INSTANCE$.check(owner, trace, null);
    JetModifierList modifierList = owner.getModifierList();
    if (modifierList == null) return;

    annotationResolver.resolveAnnotationsWithArguments(scope, modifierList, trace);
  }
Ejemplo n.º 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));
     }
   }
 }
Ejemplo n.º 3
0
 private void reportErrorIfHasIllegalModifier(JetModifierListOwner declaration) {
   if (declaration.hasModifier(JetTokens.ENUM_KEYWORD)) {
     trace.report(ILLEGAL_ENUM_ANNOTATION.on(declaration));
   }
 }
Ejemplo n.º 4
0
 @NotNull
 public static Visibility resolveVisibilityFromModifiers(
     @NotNull JetModifierListOwner modifierListOwner, @NotNull Visibility defaultVisibility) {
   return resolveVisibilityFromModifiers(modifierListOwner.getModifierList(), defaultVisibility);
 }
Ejemplo n.º 5
0
 @NotNull
 public static Modality resolveModalityFromModifiers(
     @NotNull JetModifierListOwner modifierListOwner, @NotNull Modality defaultModality) {
   return resolveModalityFromModifiers(modifierListOwner.getModifierList(), defaultModality);
 }