コード例 #1
0
ファイル: JsDescriptorUtils.java プロジェクト: hhariri/kotlin
 // TODO: maybe we have similar routine
 @Nullable
 public static ClassDescriptor getContainingClass(@NotNull DeclarationDescriptor descriptor) {
   DeclarationDescriptor containing = descriptor.getContainingDeclaration();
   while (containing != null) {
     if (containing instanceof ClassDescriptor && !isClassObject(containing)) {
       return (ClassDescriptor) containing;
     }
     containing = containing.getContainingDeclaration();
   }
   return null;
 }
コード例 #2
0
ファイル: JsDescriptorUtils.java プロジェクト: hhariri/kotlin
 @NotNull
 public static DeclarationDescriptor getContainingDeclaration(
     @NotNull DeclarationDescriptor descriptor) {
   DeclarationDescriptor containing = descriptor.getContainingDeclaration();
   assert containing != null : "Should be called on objects that have containing declaration.";
   return containing;
 }