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
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Annotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ object Annotations {
def refersToParamOf(tl: TermLambda)(using Context): Boolean =
val args = arguments
if args.isEmpty then false
else tree.existsSubTree {
case id: Ident => id.tpe.stripped match
else tree.existsSubTree:
case id: (Ident | This) => id.tpe.stripped match
case TermParamRef(tl1, _) => tl eq tl1
case _ => false
case _ => false
}

/** A string representation of the annotation. Overridden in BodyAnnotation.
*/
Expand Down
13 changes: 13 additions & 0 deletions tests/pos-custom-args/captures/i19990.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import language.experimental.captureChecking

trait Iterable[T] { self: Iterable[T]^ =>
def map[U](f: T => U): Iterable[U]^{this, f}
}

object Test {
def indentLines(level: Int, lines: Iterable[String]) =
lines.map(line => line.split("\n").map(" " + _).mkString("\n"))

def indentErrorMessages(messages: Iterable[String]) =
indentLines(1, messages)
}