playframework / playframework/twirl

Disallow block args in `if`/`else if`/`else` expressin

Open
#1,094 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
561
Forks
118
Avg merge
1d 15h
Merged PRs (30d)
29

Description

Not urgent, but currently you can write things like:

@if(true) { (something: SomeType) =>
   foo
}

I don't think that makes sense in twirl (?).

Also check other statements where we should disallow that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the parser or validation entry point for Twirl if/else expressions and reproduce the block-argument example from the issue. Check the corresponding handling of other statements, then add coverage showing that invalid block arguments are rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.