You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sealed trait that are implemented by an object containing class implementing the same trait because they are a recursive structure, generates two different models, and the second is an unknown
In GJ we have this Tree structure defined as:
sealed trait AnalyzerTree
object AnalyzerTree {
final case class Op(
opType: AnalyzerOpType,
children: NonEmptyList[AnalyzerTree],
) extends AnalyzerTree
final case class Atom(ruleConfig: RuleConfig) extends AnalyzerTree
...<some other methods here>
type referring another type with same name but different package creates recursive code
package getjenny.backofficeapi.botimport
import getjenny.organization.Organization
import getjenny.core.model.Id
import io.circe.generic.JsonCodec
@JsonCodec sealed trait BotImportError
object BotImportError {
final case class OrganizationNotFound(organizationId: Id[Organization]) extends BotImportError
final case class BotCreateError(cause: getjenny.bot.BotCreateError) extends BotImportError
I've moved the first two to new issues in metarpheus-io-ts.
For "sealed trait with only object implementation produces empty union type", I think the solution is just to make object BotNotFound a case object – non-case objects are IMO intentionally unsupported (I think it's the only non-case object implementing a sealed trait in GJ).
However, it makes sense to support sealed traits without implementations, which we do use (e.g. OrganizationListError in GJ), so I've mentioned them in buildo/metarpheus-io-ts#115.
For the last two, I'm not sure we want / need to solve them for now, but I haven't really thought about them yet, I'd give it another look before we decide what to do.
trying the new version of metarpheus in gj, we found following issues:
this
produces the following non-transipiling code:
Record
for unsupported key types metarpheus-io-ts#114↓
↓
In GJ we have this Tree structure defined as:
↓
The text was updated successfully, but these errors were encountered: