@@ -184,7 +184,7 @@ Here’s the definition of the `mapImpl` macro, which takes quoted types and exp
184
184
var i = 0
185
185
val xs = ~arr
186
186
var len = xs.length
187
- val ys = new Array[~u]
187
+ val ys = new Array[~u](len)
188
188
while (i < len) {
189
189
ys(i) = ~op(’(xs(i)))
190
190
i += 1
@@ -212,7 +212,7 @@ Here’s an application of `map` and how it rewrites to optimized code:
212
212
var i = 0
213
213
val xs = ~’($this)
214
214
var len = xs.length
215
- val ys = new Array[~’[Int]]
215
+ val ys = new Array[~’[Int]](len)
216
216
while (i < len) {
217
217
ys(i) = ~(’(f)(’(xs(i))))
218
218
i += 1
@@ -229,7 +229,7 @@ Here’s an application of `map` and how it rewrites to optimized code:
229
229
var i = 0
230
230
val xs = $this
231
231
var len = xs.length
232
- val ys = new Array[Int]
232
+ val ys = new Array[Int](len)
233
233
while (i < len) {
234
234
ys(i) = xs(i) + 1
235
235
i += 1
@@ -245,7 +245,7 @@ Here’s an application of `map` and how it rewrites to optimized code:
245
245
var i = 0
246
246
val xs = $this
247
247
var len = xs.length
248
- val ys = new Array[Int]
248
+ val ys = new Array[Int](len)
249
249
while (i < len) {
250
250
ys(i) = xs(i) + 1
251
251
i += 1
@@ -291,7 +291,7 @@ applicable without the global value exception. But in the example as
291
291
given this does not hold since both ` assert ` and ` program ` call
292
292
` assertImpl ` with a splice but no quote.
293
293
294
- However, one can could argue that the example is really missing
294
+ However, one could argue that the example is really missing
295
295
an important aspect: The macro library has to be compiled in a phase
296
296
prior to the program using it, but in the code above, macro
297
297
and program are defined together. A more accurate view of
0 commit comments