File tree 2 files changed +15
-3
lines changed
compiler/src/dotty/tools/dotc/core
tests/pos-custom-args/captures
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,11 @@ object Annotations {
72
72
def refersToParamOf (tl : TermLambda )(using Context ): Boolean =
73
73
val args = arguments
74
74
if args.isEmpty then false
75
- else tree.existsSubTree {
76
- case id : Ident => id.tpe.stripped match
75
+ else tree.existsSubTree:
76
+ case id : ( Ident | This ) => id.tpe.stripped match
77
77
case TermParamRef (tl1, _) => tl eq tl1
78
78
case _ => false
79
79
case _ => false
80
- }
81
80
82
81
/** A string representation of the annotation. Overridden in BodyAnnotation.
83
82
*/
Original file line number Diff line number Diff line change
1
+ import language .experimental .captureChecking
2
+
3
+ trait Iterable [T ] { self : Iterable [T ]^ =>
4
+ def map [U ](f : T => U ): Iterable [U ]^ {this , f}
5
+ }
6
+
7
+ object Test {
8
+ def indentLines (level : Int , lines : Iterable [String ]) =
9
+ lines.map(line => line.split(" \n " ).map(" " + _).mkString(" \n " ))
10
+
11
+ def indentErrorMessages (messages : Iterable [String ]) =
12
+ indentLines(1 , messages)
13
+ }
You can’t perform that action at this time.
0 commit comments