We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58f0f29 commit 7f64866Copy full SHA for 7f64866
tests/neg-custom-args/isInstanceOf/html.scala
@@ -0,0 +1,18 @@
1
+object HTML:
2
+ type AttrArg = AppliedAttr | Seq[AppliedAttr]
3
+ opaque type AppliedAttr = String
4
+ opaque type AppliedTag = StringBuilder
5
+
6
+ case class Tag(name: String):
7
+ def apply(attrs: AttrArg*): AppliedTag = {
8
+ val sb = StringBuilder()
9
+ sb.append(s"<$name")
10
+ attrs.filter(_ != Nil).foreach{
11
+ case s: Seq[AppliedAttr] =>
12
+ s.foreach(sb.append(" ").append)
13
+ case s: Seq[Int] => // error
14
+ case e: AppliedAttr =>
15
+ sb.append(" ").append(e)
16
+ }
17
+ sb
18
0 commit comments