File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
compiler/src/dotty/tools/dotc
tests/pos-custom-args/captures Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1190,6 +1190,10 @@ object Types {
1190
1190
/** Strip TypeVars and Annotation and CapturingType wrappers */
1191
1191
def stripped (using Context ): Type = this
1192
1192
1193
+ def strippedDealias (using Context ): Type =
1194
+ val tp1 = stripped.dealias
1195
+ if tp1 ne this then tp1.strippedDealias else this
1196
+
1193
1197
def rewrapAnnots (tp : Type )(using Context ): Type = tp.stripTypeVar match {
1194
1198
case AnnotatedType (tp1, annot) => AnnotatedType (rewrapAnnots(tp1), annot)
1195
1199
case _ => this
Original file line number Diff line number Diff line change @@ -1130,7 +1130,7 @@ class Typer extends Namer
1130
1130
case _ => mapOver(t)
1131
1131
}
1132
1132
1133
- val pt1 = pt.stripped.dealias
1133
+ val pt1 = pt.strippedDealias
1134
1134
if (pt1 ne pt1.dropDependentRefinement)
1135
1135
&& defn.isContextFunctionType(pt1.nonPrivateMember(nme.apply).info.finalResultType)
1136
1136
then
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ type Cell[+T] = [K] => (T ==> K) => K
5
5
def cell [T ](x : T ): Cell [T ] =
6
6
[K ] => (k : T ==> K ) => k(x)
7
7
8
- def get [T ](c : Cell [T ]): T = c[T ](identity[ T ]) // TODO: drop [T]
8
+ def get [T ](c : Cell [T ]): T = c[T ](identity)
9
9
10
10
def map [A , B ](c : Cell [A ])(f : A ==> B ): Cell [B ]
11
11
= c[Cell [B ]]((x : A ) => cell(f(x)))
@@ -32,7 +32,7 @@ def test(io: {*} IO) =
32
32
33
33
val r = lazyMap[{io} () => Int , Unit ](c)(f => g(f))
34
34
val r2 = lazyMap[{io} () => Int , Unit ](c)(g)
35
- // val r3 = lazyMap(c)(g) not yet
35
+ // val r3 = lazyMap(c)(g)
36
36
val _ = r()
37
37
val _ = r2()
38
38
// val _ = r3()
You can’t perform that action at this time.
0 commit comments