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 wvlet/airframe v22.11.0 #16336

Closed
dwijnand opened this issue Nov 14, 2022 · 3 comments
Closed

Regression in wvlet/airframe v22.11.0 #16336

dwijnand opened this issue Nov 14, 2022 · 3 comments
Labels
area:overloading itype:bug regression This worked in a previous version but doesn't anymore

Comments

@dwijnand
Copy link
Member

[error] -- [E134] Type Error: /home/jenkins/agent/workspace/buildCommunityProject/repo/airframe-di/src/test/scala/wvlet/airframe/di/TaggedBindingTest.scala:42:28 
[error] 39 |    val d = Design.newDesign
[error] 40 |      .bind[Fruit @@ Apple].toInstance(Fruit("apple"))
[error] 41 |      .bind[Fruit @@ Banana].toInstance(Fruit("banana"))
[error] 42 |      .bind[Fruit @@ Lemon].toProvider { (apple: Fruit @@ Apple) =>
[error]    |            ^
[error]    |None of the overloaded alternatives of method toProvider in trait BinderImpl with types
[error]    | [D1, D2, D3, D4, D5]
[error]    |  (factory: (D1, D2, D3, D4, D5) => wvlet.airframe.di.TaggedBindingTest.Fruit @@
[error]    |     wvlet.airframe.di.TaggedBindingTest.Lemon):
[error]    |    wvlet.airframe.DesignWithContext[wvlet.airframe.di.TaggedBindingTest.Fruit
[error]    |      @@ wvlet.airframe.di.TaggedBindingTest.Lemon]
[error]    | [D1, D2, D3, D4]
[error]    |  (factory: (D1, D2, D3, D4) => wvlet.airframe.di.TaggedBindingTest.Fruit @@
[error]    |    wvlet.airframe.di.TaggedBindingTest.Lemon):
[error]    |    wvlet.airframe.DesignWithContext[wvlet.airframe.di.TaggedBindingTest.Fruit
[error]    |      @@ wvlet.airframe.di.TaggedBindingTest.Lemon]
[error]    | [D1, D2, D3]
[error]    |  (factory: (D1, D2, D3) => wvlet.airframe.di.TaggedBindingTest.Fruit @@
[error]    |    wvlet.airframe.di.TaggedBindingTest.Lemon):
[error]    |    wvlet.airframe.DesignWithContext[wvlet.airframe.di.TaggedBindingTest.Fruit
[error]    |      @@ wvlet.airframe.di.TaggedBindingTest.Lemon]
[error]    | [D1, D2]
[error]    |  (factory: (D1, D2) => wvlet.airframe.di.TaggedBindingTest.Fruit @@
[error]    |    wvlet.airframe.di.TaggedBindingTest.Lemon):
[error]    |    wvlet.airframe.DesignWithContext[wvlet.airframe.di.TaggedBindingTest.Fruit
[error]    |      @@ wvlet.airframe.di.TaggedBindingTest.Lemon]
[error]    | [D1]
[error]    |  (factory: D1 => wvlet.airframe.di.TaggedBindingTest.Fruit @@
[error]    |    wvlet.airframe.di.TaggedBindingTest.Lemon):
[error]    |    wvlet.airframe.DesignWithContext[wvlet.airframe.di.TaggedBindingTest.Fruit
[error]    |      @@ wvlet.airframe.di.TaggedBindingTest.Lemon]
[error]    |match arguments (wvlet.airframe.di.TaggedBindingTest.Fruit @@
[error]    |  wvlet.airframe.di.TaggedBindingTest.Apple =>
[error]    |  wvlet.airframe.di.TaggedBindingTest.Fruit)
[error] one error found
[error] (diJVM / Test / compileIncremental) Compilation failed
  case class Fruit(name: String)

  trait Apple
  trait Banana
  trait Lemon

  test("support tagged binding") {
    val apple = Surface.of[Fruit @@ Apple]
    debug(s"apple: ${apple}, alias:${apple.isAlias}")

    val d = Design.newDesign
      .bind[Fruit @@ Apple].toInstance(Fruit("apple"))
      .bind[Fruit @@ Banana].toInstance(Fruit("banana"))
      .bind[Fruit @@ Lemon].toProvider { (apple: Fruit @@ Apple) =>
        Fruit(s"lemon+${apple.name}").asInstanceOf[Fruit @@ Lemon]
      }
@dwijnand dwijnand added itype:bug area:overloading regression This worked in a previous version but doesn't anymore stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 14, 2022
@dwijnand dwijnand changed the title wvlet/airframe v22.11.0 Regression in wvlet/airframe v22.11.0 Nov 14, 2022
@jchyb jchyb removed the stat:needs triage Every issue needs to have an "area" and "itype" label label Nov 15, 2022
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.
@odersky
Copy link
Contributor

odersky commented Nov 16, 2022

would be good to check again. I hope it is fixed by #16344.

@Kordyjan Kordyjan added this to the Future versions milestone Dec 12, 2022
@Gedochao
Copy link
Contributor

Gedochao commented Jul 3, 2024

@dwijnand @odersky is this still valid?

@dwijnand
Copy link
Member Author

dwijnand commented Jul 8, 2024

I'm not sure, but I think we have a better way to track jenkins community projects, so I'll close this out.

@dwijnand dwijnand closed this as completed Jul 8, 2024
@Gedochao Gedochao closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:overloading itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

No branches or pull requests

5 participants