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

can not use using/given in twirl templates #839

Open
Tasselmi opened this issue Sep 29, 2024 · 1 comment
Open

can not use using/given in twirl templates #839

Tasselmi opened this issue Sep 29, 2024 · 1 comment

Comments

@Tasselmi
Copy link

Tasselmi commented Sep 29, 2024

Play Version

3.0.5

API

scala 3.3.3

Operating System

ubuntu 20.04

JDK

17.0.9

Library Dependencies

twirl default version with play framework

Expected Behavior

  1. we can use given/using in scala3 , it is very import tools to replace implict
  2. twirl supports scala3
  3. so we can use given/using in twirl

Actual Behavior

  1. can not identify using keyword in a template file, when it is used as function parameters

Reproducible Test Case

on top of a template, we define the input parameters like this:
@(tagList: Seq[TagCloud], bottomFlag: Boolean = false)(using siteConfig: play.api.Configuration)

error log:
/app/views/index.scala.html:6:66: By-name parameter type => play.twirl.api.HtmlFormat.Appendable not allowed here.
@mkurz mkurz transferred this issue from playframework/playframework Sep 29, 2024
@mkurz
Copy link
Member

mkurz commented Sep 30, 2024

The @(....)(using some_name: some_type) syntax is currently just not support by twirl - the parser does not understand the using keyword yet.. Are you keen to provide a PR for that? I could guide you if you need help.

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

2 participants