示例#1
0
 @Nullable
 private static ClassDescriptor getEnumEntry(
     @NotNull ClassDescriptor enumDescriptor, @NotNull String entryName) {
   ClassifierDescriptor result =
       enumDescriptor
           .getUnsubstitutedInnerClassesScope()
           .getContributedClassifier(Name.identifier(entryName), NoLookupLocation.FROM_BUILTINS);
   return result instanceof ClassDescriptor ? (ClassDescriptor) result : null;
 }
  private static void addResultsForClass(
      @NotNull @Mutable Set<LookupResult> results,
      @NotNull JetSimpleNameExpression selector,
      @NotNull LookupMode lookupMode,
      @NotNull ClassDescriptor descriptor) {
    JetScope scope =
        lookupMode == LookupMode.ONLY_CLASSES_AND_PACKAGES
            ? descriptor.getUnsubstitutedInnerClassesScope()
            : descriptor.getDefaultType().getMemberScope();
    results.add(lookupSimpleNameReference(selector, scope, lookupMode, false));

    results.add(lookupSimpleNameReference(selector, descriptor.getStaticScope(), lookupMode, true));
  }