Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination .mend(???).within(???) not working inside split block #22

Open
NPCRUS opened this issue Nov 20, 2024 · 0 comments
Open

Combination .mend(???).within(???) not working inside split block #22

NPCRUS opened this issue Nov 20, 2024 · 0 comments

Comments

@NPCRUS
Copy link
Contributor

NPCRUS commented Nov 20, 2024

trait Defooler[T] {
    def defool(a: String): Option[String]
  }
  object Defooler extends Derivation[Defooler] {
    inline def join[DerivationType <: Product](using ProductReflection[DerivationType]): Defooler[DerivationType] = ???

    inline def split[DerivationType](using SumReflection[DerivationType]): Defooler[DerivationType] = str =>
      mend {
        case e: VariantError =>
          Left(e.getMessage)
      }.within {
        delegate(str)([VariantType <: DerivationType] => defooler =>
          defooler.defool(str)  
        )
      }
  }

produces:

value within is not a member of Any.
An extension method was tried, but could not be fully constructed:

    contingency.within()

    failed with:

        value within: <overloaded contingency.within> does not take parameters

at .within

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant