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

Regression in plokhotnyuk/jsoniter-scala v2.17.9 #16342

Closed
dwijnand opened this issue Nov 14, 2022 · 1 comment · Fixed by #16344
Closed

Regression in plokhotnyuk/jsoniter-scala v2.17.9 #16342

dwijnand opened this issue Nov 14, 2022 · 1 comment · Fixed by #16344
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@dwijnand
Copy link
Member

[error] -- [E008] Not Found Error: /home/jenkins/agent/workspace/buildCommunityProject/repo/jsoniter-scala-macros/shared/src/test/scala/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerSpec.scala:38:71 
[error] 38 |    def unapply(userId: Opaque): Option[String] = Option(userId).map(_.value)
[error]    |                                                                     ^^^^^^^
[error]    |value value is not a member of com.github.plokhotnyuk.jsoniter_scala.macros.UserId2.Tag
[error] -- [E008] Not Found Error: /home/jenkins/agent/workspace/buildCommunityProject/repo/jsoniter-scala-macros/shared/src/test/scala/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerSpec.scala:58:70 
[error] 58 |    def unapply(orderId: Opaque): Option[Int] = Option(orderId).map(_.value)
[error]    |                                                                    ^^^^^^^
[error]    |value value is not a member of com.github.plokhotnyuk.jsoniter_scala.macros.OrderId2.Tag
[error] two errors found
[error] (jsoniter-scala-macrosJVM / Test / compileIncremental) Compilation failed
  type Opaque = Base with Tag

  type Base = Any {
    type Hack
  }

  trait Tag

  object Opaque {
    def apply(value: String): Opaque = value.asInstanceOf[Opaque]

    def unapply(userId: Opaque): Option[String] = Option(userId).map(_.value)
  }

  final implicit class Ops(private val userId: Opaque) extends AnyVal {
    def value: String = userId.asInstanceOf[String]
  }
@dwijnand dwijnand changed the title plokhotnyuk/jsoniter-scala v2.17.9 Regression in plokhotnyuk/jsoniter-scala v2.17.9 Nov 14, 2022
@dwijnand dwijnand added itype:bug area:typer regression This worked in a previous version but doesn't anymore labels Nov 14, 2022
@odersky
Copy link
Contributor

odersky commented Nov 14, 2022

I verified that this is in fact caused by #15642. Need to dig deeper why.

odersky added a commit to dotty-staging/dotty that referenced this issue Nov 15, 2022
Two fixes:

 1. Don't forget about refinements
 2. Don't dealias

Fixes scala#16342

The first fix is essential for $16342. The second fix is just to keep
types tidy and not open aliases needlessly.

The previous incorrect version hid errors in previous regressions scala#15365 and scala#16311
which will need to be re-opened now.
odersky added a commit that referenced this issue Nov 15, 2022
Two fixes:

 1. Don't forget about refinements
 2. Don't dealias

Fixes #16342
Fixes #16338

The first fix is essential for #16342. The second fix is just to keep
types tidy and not open aliases needlessly.

It probably fixes issues #16337 and #16336 as well, but the test cases
were not self-contained, so I could not try them out. It might fix other
recent regressions as well.

The previous incorrect version hid errors in previous regressions #15365
and #16311 which will need to be re-opened now.
little-inferno pushed a commit to little-inferno/dotty that referenced this issue Jan 25, 2023
Two fixes:

 1. Don't forget about refinements
 2. Don't dealias

Fixes scala#16342

The first fix is essential for $16342. The second fix is just to keep
types tidy and not open aliases needlessly.

The previous incorrect version hid errors in previous regressions scala#15365 and scala#16311
which will need to be re-opened now.
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants