diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b5e09b09b..ea1424848 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -64,7 +64,7 @@ jobs: DEST_DIR="arkanalyzer" MAX_RETRIES=10 RETRY_DELAY=3 # Delay between retries in seconds - BRANCH="neo/2025-04-14" + BRANCH="neo/2025-05-30b" for ((i=1; i<=MAX_RETRIES; i++)); do git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt index 50e6beed4..ddf297fc7 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Convert.kt @@ -45,6 +45,7 @@ import org.jacodb.ets.model.EtsDecorator import org.jacodb.ets.model.EtsDeleteExpr import org.jacodb.ets.model.EtsDivExpr import org.jacodb.ets.model.EtsEntity +import org.jacodb.ets.model.EtsEnumValueType import org.jacodb.ets.model.EtsEqExpr import org.jacodb.ets.model.EtsExpExpr import org.jacodb.ets.model.EtsExpr @@ -492,6 +493,11 @@ fun TypeDto.toEtsType(): EtsType = when (this) { is ClassTypeDto -> toEtsClassType() + is EnumValueTypeDto -> EtsEnumValueType( + signature = signature.toEtsFieldSignature(), + constant = constant?.toEtsConstant(), + ) + is FunctionTypeDto -> EtsFunctionType( signature = signature.toEtsMethodSignature(), typeParameters = typeParameters.map { it.toEtsType() }, diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt index 2f1d2f569..bed8028f9 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/dto/Types.kt @@ -61,6 +61,13 @@ data class AliasTypeDto( val signature: LocalSignatureDto, ) : TypeDto +@Serializable +@SerialName("EnumValueType") +data class EnumValueTypeDto( + val signature: FieldSignatureDto, + val constant: ConstantDto? = null, +): TypeDto + @Serializable @SerialName("VoidType") data object VoidTypeDto : TypeDto diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Type.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Type.kt index 8b237ca92..584a961ab 100644 --- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Type.kt +++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Type.kt @@ -30,6 +30,7 @@ interface EtsType : TypeName, CommonType { fun visit(type: EtsIntersectionType): R fun visit(type: EtsGenericType): R fun visit(type: EtsAliasType): R + fun visit(type: EtsEnumValueType): R // Primitive fun visit(type: EtsBooleanType): R @@ -62,6 +63,7 @@ interface EtsType : TypeName, CommonType { override fun visit(type: EtsIntersectionType): R = defaultVisit(type) override fun visit(type: EtsGenericType): R = defaultVisit(type) override fun visit(type: EtsAliasType): R = defaultVisit(type) + override fun visit(type: EtsEnumValueType): R = defaultVisit(type) override fun visit(type: EtsBooleanType): R = defaultVisit(type) override fun visit(type: EtsNumberType): R = defaultVisit(type) @@ -371,3 +373,17 @@ data class EtsFunctionType( return visitor.visit(this) } } + +data class EtsEnumValueType( + val signature: EtsFieldSignature, + val constant: EtsConstant? = null, +): EtsType { + override val typeName: String + get() = signature.name + + override fun toString(): String = typeName + + override fun accept(visitor: EtsType.Visitor): R { + return visitor.visit(this) + } +}