From 2f76bf8e472825eb004069448fd176587f013caf Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Sun, 22 Oct 2023 21:22:04 +0100 Subject: [PATCH] Remove some leftover data classes They were missed due to a bug in the data class detection (see previous commit). --- foundation/api/foundation.api | 14 -------------- .../jewel/foundation/lazy/tree/BuildTree.kt | 11 ++++++++--- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/foundation/api/foundation.api b/foundation/api/foundation.api index e2173d4ea..70c588d63 100644 --- a/foundation/api/foundation.api +++ b/foundation/api/foundation.api @@ -349,11 +349,6 @@ public final class org/jetbrains/jewel/foundation/lazy/tree/ChildrenGeneratorSco public final class org/jetbrains/jewel/foundation/lazy/tree/ChildrenGeneratorScope$ParentInfo { public static final field $stable I public fun (Ljava/lang/Object;II)V - public final fun component1 ()Ljava/lang/Object; - public final fun component2 ()I - public final fun component3 ()I - public final fun copy (Ljava/lang/Object;II)Lorg/jetbrains/jewel/foundation/lazy/tree/ChildrenGeneratorScope$ParentInfo; - public static synthetic fun copy$default (Lorg/jetbrains/jewel/foundation/lazy/tree/ChildrenGeneratorScope$ParentInfo;Ljava/lang/Object;IIILjava/lang/Object;)Lorg/jetbrains/jewel/foundation/lazy/tree/ChildrenGeneratorScope$ParentInfo; public fun equals (Ljava/lang/Object;)Z public final fun getData ()Ljava/lang/Object; public final fun getDepth ()I @@ -558,10 +553,6 @@ public abstract class org/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Eleme public final class org/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Leaf : org/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element { public static final field $stable I public fun (Ljava/lang/Object;Ljava/lang/Object;)V - public final fun component1 ()Ljava/lang/Object; - public final fun component2 ()Ljava/lang/Object; - public final fun copy (Ljava/lang/Object;Ljava/lang/Object;)Lorg/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Leaf; - public static synthetic fun copy$default (Lorg/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Leaf;Ljava/lang/Object;Ljava/lang/Object;ILjava/lang/Object;)Lorg/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Leaf; public fun equals (Ljava/lang/Object;)Z public final fun getData ()Ljava/lang/Object; public fun getId ()Ljava/lang/Object; @@ -572,11 +563,6 @@ public final class org/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$ public final class org/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Node : org/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element { public static final field $stable I public fun (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V - public final fun component1 ()Ljava/lang/Object; - public final fun component2 ()Ljava/lang/Object; - public final fun component3 ()Lkotlin/jvm/functions/Function1; - public final fun copy (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Node; - public static synthetic fun copy$default (Lorg/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Node;Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/jetbrains/jewel/foundation/lazy/tree/TreeBuilder$Element$Node; public fun equals (Ljava/lang/Object;)Z public final fun getChildrenGenerator ()Lkotlin/jvm/functions/Function1; public final fun getData ()Ljava/lang/Object; diff --git a/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/tree/BuildTree.kt b/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/tree/BuildTree.kt index ad97b8d95..8d88ae786 100644 --- a/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/tree/BuildTree.kt +++ b/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/tree/BuildTree.kt @@ -1,5 +1,6 @@ package org.jetbrains.jewel.foundation.lazy.tree +import org.jetbrains.jewel.foundation.GenerateDataFunctions import java.io.File import java.nio.file.Path @@ -11,8 +12,11 @@ class TreeBuilder : TreeGeneratorScope { abstract val id: Any? - data class Leaf(val data: T, override val id: Any?) : Element() - data class Node( + @GenerateDataFunctions + class Leaf(val data: T, override val id: Any?) : Element() + + @GenerateDataFunctions + class Node( val data: T, override val id: Any?, val childrenGenerator: ChildrenGeneratorScope.() -> Unit, @@ -130,7 +134,8 @@ interface TreeGeneratorScope { class ChildrenGeneratorScope(private val parentElement: Tree.Element.Node) : TreeGeneratorScope { - data class ParentInfo(val data: T, val depth: Int, val index: Int) + @GenerateDataFunctions + class ParentInfo(val data: T, val depth: Int, val index: Int) val parent by lazy { ParentInfo(parentElement.data, parentElement.depth, parentElement.childIndex) }