no type arguments for views?
See original GitHub issue@refried originally filed as https://github.com/playframework/playframework/issues/2194. migrating it here
views/foo1.scala.txt (won’t compile)
@[L<:shapeless.Nat:shapeless.ops.nat.ToInt](bar: Bar[L])
@bar has size @shapeless.Nat.toInt[L]
views/foo2.scala.txt (will compile, but silly!)
@(bar: Bar[_<:shapeless.Nat], size: Int)
@bar has size @size
controllers/Application.scala
package controllers
import play.api._
import play.api.mvc._
import shapeless.Nat
import shapeless.ops.nat.ToInt
class Bar[L<:Nat]
object Application extends Controller {
def index = Action {
Ok(views.html.index("Your new application is ready."))
}
// won't compile
def foo1 = views.txt.foo1(new Bar[Nat._3])
// needlessly complicated
def foo2 = {
def barSize[L<:Nat:ToInt](bar: Bar[L]): Int = Nat.toInt[L]
val bar = new Bar[Nat._3]
val size = barSize(bar)
views.txt.foo2(bar, size)
}
}
Issue Analytics
- State:
- Created 9 years ago
- Reactions:6
- Comments:14 (2 by maintainers)
Top Results From Across the Web
No type arguments expected for fun findViewById(p0: Int): View
i tried to declare an imageView on Kotlin like this : view.findViewById<ImageView>(R.
Read more >No type arguments expected for fun findViewById(p0: Int): View!
No type arguments expected for fun findViewById(p0: Int): View! ; Project, Kotlin ; Priority, Not specified ; Type, Bug B ; Target versions,...
Read more >Type '<typename>' has no type parameters and so cannot ...
Non -generic types do not accept type parameters, and you cannot specify any type arguments when you invoke such a type. Error ID:...
Read more >PEP 484 – Type Hints - Python Enhancement Proposals
It is recommended but not required that checked functions have annotations for all arguments and the return type. For a checked function, the...
Read more >Pass data between destinations - Android Developers
Supported argument types; Override a destination argument in an ... Click the Text tab to toggle to XML view, and notice that your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, FWIW, a workaround is to use the string interpolator:
Related #153