Skip to content

Opaque types don't work if placed outside of the companion object of a table class #10

@chuwy

Description

@chuwy

In the below code:

  opaque type Id = Long
  inline given IsColumn[Id] = ???

  case class Task(id: Id, title: Task.Title)
  object Task:
    opaque type Title = String
    inline given IsColumn[Title] = ???

    val table = Table.of[Task].withName("tasks").build

Columns in table end up being:

(TypedColumn["id", Long, "tasks", EmptyTuple], TypedColumn["title", Task.Title, "tasks", EmptyTuple])

And the only difference between Id and Title is that they're defined at different levels. I managed to narrow down this problem to quotidian.MacroMirror, i.e. at this moment at the very beginning of MacroTable existence I already have wrong types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions