- Notifications
You must be signed in to change notification settings - Fork3.1k
Commit71dc0c3
committed
Use
In `<a><b/><c/><a>`, a `NodeBuffer` (which extends `ArrayBuffer`) isused to accumulate the children. The buffer is passed to`new Elem($buf: _*)`, which only works thanks to the implicit`collection.Seq[Node] => NodeSeq` declared in scala-xml.With `-Vprint:typer`:```scalascala> <a><b/></a>[[syntax trees at end of typer]] // <console> private[this] val res0: scala.xml.Elem = new scala.xml.Elem(null, "a", scala.xml.Null, scala.xml.TopScope, false, (xml.this.NodeSeq.seqToNodeSeq({ val $buf: scala.xml.NodeBuffer = new scala.xml.NodeBuffer(); $buf.&+(new scala.xml.Elem(null, "b", scala.xml.Null, scala.xml.TopScope, true)); $buf }): _*));```The implicit was not inserted in 2.12 because the varargs parameter ofElem accepted a `collection.Seq`.toVector
for XML literal sequences1 parent7e411f1 commit71dc0c3
File tree
6 files changed
+37
-19
lines changed- src/compiler/scala/tools/nsc/ast/parser
- test/files/run
- t9027
6 files changed
+37
-19
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
391 | 391 |
| |
392 | 392 |
| |
393 | 393 |
| |
394 |
| - | |
| 394 | + | |
395 | 395 |
| |
396 | 396 |
| |
397 | 397 |
| |
|
Lines changed: 8 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| 65 | + | |
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
72 |
| - | |
| 73 | + | |
73 | 74 |
| |
74 | 75 |
| |
75 | 76 |
| |
| |||
111 | 112 |
| |
112 | 113 |
| |
113 | 114 |
| |
114 |
| - | |
| 115 | + | |
115 | 116 |
| |
116 | 117 |
| |
117 | 118 |
| |
| |||
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
169 |
| - | |
| 170 | + | |
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
| |||
176 | 177 |
| |
177 | 178 |
| |
178 | 179 |
| |
179 |
| - | |
| 180 | + | |
180 | 181 |
| |
181 | 182 |
| |
182 | 183 |
| |
183 |
| - | |
| 184 | + | |
| 185 | + | |
184 | 186 |
| |
185 | 187 |
| |
186 | 188 |
| |
| |||
191 | 193 |
| |
192 | 194 |
| |
193 | 195 |
| |
194 |
| - | |
| 196 | + | |
195 | 197 |
| |
196 | 198 |
| |
197 | 199 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
| 46 | + | |
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 |
| - | |
| 57 | + | |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 |
| - | |
| 43 | + | |
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
|
Lines changed: 12 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
9 |
| - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 |
| |
11 | 20 |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 |
|
0 commit comments
Comments
(0)