Allow to compile akka-http
module with Scala 3
#4091
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This mostly involves specifying types for implicit vals and adding correct parentheses in lambda types. Compilation with
-source:3.0-migration
was simple, requiring only passing some implicits explicitly inPathDirectives
. When I removed the option, another slightly more severe issue popped up, with the compiler seemingly incorrectly inferring types used in javadsl/scaladsl mappings - because of that, the compiler was unable to find the correct implicit. This was fixed by manually specifying types in places like this. What's interesting, this only happened when going through a collection previously converted from java collection (viascala.collections.JavaConverters
). This can be for example observed inRejections.scala
.Nevertheless, now the 'akka-http' module compiles with both 3.1.1, 3.1.2-RC3 and 2.13.8 (2.12.15 errored at the
akka-http-core
module).References #4079, task "Enable
akka-http
module for Scala 3 (currently disabled in Scala 3) and make main code compile"