File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,8 @@ trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] =>
136
136
137
137
/** All term arguments of an application in a single flattened list */
138
138
def allArguments (tree : Tree ): List [Tree ] = unsplice(tree) match {
139
- case Apply (fn, args) => allArguments(fn) ::: args
139
+ case Apply (fn, args) => allArguments(fn) ::: args.flatMap(allArguments)
140
+ case TypeApply (Select (fn, n), _) if n == nme.asInstanceOf_ => fn :: Nil
140
141
case TypeApply (fn, _) => allArguments(fn)
141
142
case Block (_, expr) => allArguments(expr)
142
143
case _ => Nil
Original file line number Diff line number Diff line change @@ -562,9 +562,8 @@ object Erasure {
562
562
report.error(msg, tree.srcPos)
563
563
tree.symbol.getAnnotation(defn.CompileTimeOnlyAnnot ) match
564
564
case Some (annot) =>
565
- val message = annot.argumentConstant(0 ) match
566
- case Some (c) =>
567
- c.stringValue.toMessage
565
+ val message = annot.argumentConstantString(0 ) match
566
+ case Some (c) => c.toMessage
568
567
case _ =>
569
568
em """ Reference to ${tree.symbol.showLocated} should not have survived,
570
569
|it should have been processed and eliminated during expansion of an enclosing macro or term erasure. """
Original file line number Diff line number Diff line change
1
+ -- Error: tests/neg/no-unit.scala:2:8 ----------------------------------------------------------------------------------
2
+ 2 |val u = Unit // error
3
+ | ^^^^
4
+ | `Unit` companion object is not allowed in source; instead, use `()` for the unit value
Original file line number Diff line number Diff line change
1
+
2
+ val u = Unit // error
You can’t perform that action at this time.
0 commit comments