Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Annotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ object Annotations {

/** A deferred annotation to the result of a given child computation */
def later(delayedSym: (given Context) => Symbol, span: Span)(implicit ctx: Context): Annotation = {
def makeChildLater(implicit ctx: Context) = {
def makeChildLater(given ctx: Context) = {
val sym = delayedSym
New(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
.withSpan(span)
}
deferred(defn.ChildAnnot)(makeChildLater(ctx))
deferred(defn.ChildAnnot)(makeChildLater)
}

/** A regular, non-deferred Child annotation */
Expand Down
4 changes: 4 additions & 0 deletions compiler/test-resources/repl/7472
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scala> val list = List(1, 2, 3)
val list: List[Int] = List(1, 2, 3)
scala> list.foldLeft(List.empty[Int]){ case (acc, n) => n :: acc }
val res0: List[Int] = List(3, 2, 1)