File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -1371,5 +1371,18 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
1371
1371
*/
1372
1372
def repeated (trees : List [Tree ], tpt : Tree )(given ctx : Context ): Tree =
1373
1373
ctx.typeAssigner.arrayToRepeated(JavaSeqLiteral (trees, tpt))
1374
- }
1375
1374
1375
+ /** Create a tree representing a list containing all
1376
+ * the elements of the argument list. A "list of tree to
1377
+ * tree of list" conversion.
1378
+ *
1379
+ * @param trees the elements the list represented by
1380
+ * the resulting tree should contain.
1381
+ * @param tpe the type of the elements of the resulting list.
1382
+ *
1383
+ */
1384
+ def mkList (trees : List [Tree ], tpe : Tree )(given Context ): Tree =
1385
+ ref(defn.ListModule ).select(nme.apply)
1386
+ .appliedToTypeTree(tpe)
1387
+ .appliedToVarargs(trees, tpe)
1388
+ }
Original file line number Diff line number Diff line change @@ -240,9 +240,7 @@ object Inliner {
240
240
private def packErrors (errors : List [(ErrorKind , Error )])(given Context ): Tree =
241
241
val individualErrors : List [Tree ] = errors.map(packError)
242
242
val errorTpt = ref(defn.CompiletimeTesting_ErrorClass )
243
- ref(defn.ListModule ).select(nme.apply)
244
- .appliedToTypeTree(errorTpt)
245
- .appliedToVarargs(individualErrors, errorTpt)
243
+ mkList(individualErrors, errorTpt)
246
244
247
245
/** Expand call to scala.compiletime.testing.typeChecks */
248
246
def typeChecks (tree : Tree )(given Context ): Tree =
You can’t perform that action at this time.
0 commit comments