playframework / playframework/twirl

Support for Type Parameters

Open
#153 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted status:backlog
Dominant language
Scala
Stars
561
Forks
118
Avg merge
1d 15h
Merged PRs (30d)
29

Description

At the moment it is only possible to use Type classes with a wildcard, thus loosing all type information

@import TypedCaseClass
 @(typedCaseClass: TypedCaseClass[_])(implicit request: RequestHeader, 
  messages: Messages){
   //...
 }

It would be nice, if something like this would be possible:

@import TypedCaseClass
 @[T](typedCaseClass: TypedCaseClass[T])(implicit request: RequestHeader, 
  messages: Messages){
   //...
 }

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

No files, tests, or entry points are identified. Start by reproducing the two template snippets and determine how the requested generic parameter syntax should preserve type information while keeping wildcard usage valid; done means the second example is supported without regressing the first.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.