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

add support for Scala 3 #15

Merged
merged 12 commits into from
Nov 3, 2023
Merged

add support for Scala 3 #15

merged 12 commits into from
Nov 3, 2023

Conversation

dwickern
Copy link
Owner

@dwickern dwickern commented Nov 1, 2023

Play 2.9 supports Scala 3.

@dwickern
Copy link
Owner Author

dwickern commented Nov 1, 2023

@gmethvin are these errors expected when compiling for Scala 3? An explicit return type seems to fix it, e.g. def getResources: Action[AnyContent] = ... but I couldn't find anything in the migration guide.

[error] -- [E051] Reference Error: /home/runner/work/swagger-play/swagger-play/src/main/scala/controllers/ApiHelpController.scala:39:34 
[error] 39 |  def getResource(path: String) = Action { implicit request =>
[error]    |                                  ^^^^^^
[error]    |Ambiguous overload. The overloaded alternatives of method apply in trait ActionBuilder with types
[error]    | (block: play.api.mvc.Request[play.api.mvc.AnyContent] => play.api.mvc.Result):
[error]    |  play.api.mvc.Action[play.api.mvc.AnyContent]
[error]    | [A]
[error]    |  (bodyParser: play.api.mvc.BodyParser[A]):
[error]    |    play.api.mvc.ActionBuilder[play.api.mvc.Request, A]
[error]    |both match arguments (<?> => <?>)
[error]    |----------------------------------------------------------------------------
[error]    | Explanation (enabled by `-explain`)
[error]    |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error]    | There are 2 methods that could be referenced as the compiler knows too little
[error]    | about the expected type.
[error]    | You may specify the expected type e.g. by
[error]    | - assigning it to a value with a specified type, or
[error]    | - adding a type ascription as in instance.myMethod: String => Int
[error]     ----------------------------------------------------------------------------
[error] Explanation
[error] ===========
[error] There are 2 methods that could be referenced as the compiler knows too little
[error] about the expected type.
[error] You may specify the expected type e.g. by
[error] - assigning it to a value with a specified type, or
[error] - adding a type ascription as in instance.myMethod: String => Int
[error] two errors found
[error] (swaggerplay293 / Compile / compileIncremental) Compilation failed

@gmethvin
Copy link

gmethvin commented Nov 2, 2023

@dwickern Interesting, yeah, that should probably be mentioned in the migration guide, or maybe the API needs to be improved so that doesn't happen.

@dwickern dwickern merged commit 4c10872 into master Nov 3, 2023
13 checks passed
@dwickern dwickern deleted the scala3 branch November 3, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants