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
Issues with Scala 2.13.7 #1417
Comments
I'm not sure what changed in 2.13.7 to cause this, but this version seems to have broken a bunch of things in the ecosystem. For the endpoints that don't take arguments to their mapping function you can fix them by adding an empty argument block: val list = get(zero) { () =>
Ok(List(1, 2, 3).asJson)
} However the |
This would have been caught ahead of time (before 2.13.7 was released) if Finch were in the Scala 2 community build. I've opened a PR to add it, here: scala/community-build#1504 |
FWIW there seems to be something odd with finch/core/src/main/scala/io/finch/internal/Mapper.scala Lines 79 to 81 in 298889b
Given the error message, I would have expected the implicit conversion Output => Mapper to kick in, but it's clearly not happening |
I was wondering if there is any way to trace and log implicit resolution (I think there is) and the check it with 2.13.7 and 2.13.6 |
You can enable the |
We're aiming to build 2.13.8 circa Dec 10 (I'll be announcing this soon on contributors.scala-lang.org), so time is running short for a minimized bug report if you were hoping this might get fixed in that release. |
@SethTisue what would you consider ideal for a minimized bug report? Would extracting the failing finch examples from @mfirry's repo into a smaller self contained one be enough for a bug report on the Scala bug tracker? Or would it need to minimized further to exclude Finch entirely? |
It’s strongly preferable to have a reproduction without an external JAR involved, so that we can turn it directly into a regression test. |
@rpless, happy to help. Let me know if this is useful => https://github.com/mfirry/finch-repro-1417 |
Thanks @mfirry. I'm hoping we can get a repro without dependencies, but we'll see. Did a little digging this morning. One thing I noticed is that this still compiles: val sayHello: Endpoint[IO, Buf] = get("hello" :: param[String]("one") :: param[String]("two"))(
(one: String, two: String) =>
Ok(Buf.Utf8(s"Hello, $one. Hello $two"))) Which kinda tells me that any Mapper that needs to summon a |
Perhaps scala/scala#9691 surfaced a diverging implicit error |
This would fix it: --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -1101,10 +1101,10 @@ trait Infer extends Checkable {
enhanceBounds(adjusted.okParams, adjusted.okArgs, xs1)
xs1
}
- } else undetParams
+ } else if (context.implicitsEnabled) undetParams else Nil
} catch ifNoInstance { msg =>
NoMethodInstanceError(fn, args, msg)
- undetParams
+ if (context.implicitsEnabled) undetParams else Nil
}
case x => throw new MatchError(x)
} Now all we need is a minimal reproduction and a ticket in scala/bug |
What I missed in that PR was that if we are already typechecking an implicit view we can't recover with another implicit view. |
I think we can safely close that now - it was a regression in Scala 2.13.7 and the fix will be released with 2.13.8 |
I confirm 2.13.8 fixes it for me. Thanks everyone! |
Hi all,
I think it's a bit weird that my code is not compiling with 2.13.7 but it does with 2.13.6.
Specifically with the following:
I now get
(the complete code can be found here)
The text was updated successfully, but these errors were encountered: