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

Compilation error in pattern matching in Twirl 1.4.x #222

Closed
takezoe opened this issue Jun 1, 2019 · 5 comments
Closed

Compilation error in pattern matching in Twirl 1.4.x #222

takezoe opened this issue Jun 1, 2019 · 5 comments

Comments

@takezoe
Copy link

takezoe commented Jun 1, 2019

The following template have worked in Twirl 1.3.15.

@defining(content.split(":")){ case Array(head, rest @ _*) =>
  ...
}

But it fails to compile with Expected '}' but found '@' in Twirl 1.4.1.

@takezoe
Copy link
Author

takezoe commented Jun 1, 2019

This works:

@defining(content.split(":")){ case Array(head, rest @ _*) => {
  ...
}}

Is this intended change?

@mkurz
Copy link
Member

mkurz commented Jun 1, 2019

Yes, kind of intended, that's a result of #192 and #194. We might want to add this to the Play Framework migration notes however.

@mkurz mkurz closed this as completed Jun 1, 2019
@takezoe
Copy link
Author

takezoe commented Jun 1, 2019

I see. Thanks.

We might want to add this to the Play Framework migration notes however.

This change will break a lot of Twirl based Play applications. So describing in Play's migration notes would help Play users.

@takezoe
Copy link
Author

takezoe commented Jun 1, 2019

JFYI: Although this is not a Play application, I needed the following changes to migrate Twirl 1.3.x to 1.4.x: https://github.com/gitbucket/gitbucket/pull/2320/files

@takezoe takezoe changed the title Compilation error in Array pattern matching in Twirl 1.4.1 Compilation error in pattern matching in Twirl 1.4.x Jun 2, 2019
@ignasi35
Copy link
Member

thanks for reporting @takezoe . Raised playframework/playframework#9411

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

No branches or pull requests

3 participants