@ import $ivy.`com.lihaoyi::scalatags:0.6.0`
import $ivy.$
@
class Templates[Builder, Output <: FragT, FragT](val bundle: scalatags.generic.Bundle[Builder, Output, FragT]){
import bundle.all._
val x: Tag = div("hello")
}
cmd1.sc:3: type mismatch;
found : Templates.this.bundle.all.div.Self
required: Templates.this.bundle.all.Tag
val x: Tag = div("hello")
^
Compilation Failed
You can of course use asInstanceOf to shut it up, and generally you should probably be working with Frags anyway (which does work correctly). Regardless, there are good uses for the Tag type (e.g. if you want to construct a fragment, and then add additional children or attributes to it) so this really should just work
You can of course use
asInstanceOf
to shut it up, and generally you should probably be working withFrag
s anyway (which does work correctly). Regardless, there are good uses for theTag
type (e.g. if you want to construct a fragment, and then add additional children or attributes to it) so this really should just work