File tree Expand file tree Collapse file tree 5 files changed +6
-8
lines changed
compiler/src/dotty/tools/dotc
tests/pos-custom-args/captures Expand file tree Collapse file tree 5 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1393,6 +1393,7 @@ class Definitions {
1393
1393
funTypeArray(funTypeIdx(isContextual, isErased, isImpure))(n).symbol
1394
1394
1395
1395
@ tu lazy val Function0_apply : Symbol = Function0 .requiredMethod(nme.apply)
1396
+ @ tu lazy val ContextFunction0_apply : Symbol = ContextFunction0 .requiredMethod(nme.apply)
1396
1397
1397
1398
@ tu lazy val Function0 : Symbol = FunctionSymbol (0 )
1398
1399
@ tu lazy val Function1 : Symbol = FunctionSymbol (1 )
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ class TreePickler(pickler: TastyPickler) {
198
198
else if (tpe.prefix == NoPrefix ) {
199
199
writeByte(if (tpe.isType) TYPEREFdirect else TERMREFdirect )
200
200
if ! symRefs.contains(sym) && ! sym.isPatternBound && ! sym.hasAnnotation(defn.QuotedRuntimePatterns_patternTypeAnnot ) then
201
- report.error (i " pickling reference to as yet undefined $tpe with symbol ${sym}" , sym.srcPos)
201
+ report.log (i " pickling reference to as yet undefined $tpe with symbol ${sym}" , sym.srcPos)
202
202
pickleSymRef(sym)
203
203
}
204
204
else tpe.designator match {
Original file line number Diff line number Diff line change @@ -467,11 +467,8 @@ class CheckCaptures extends Recheck:
467
467
recheckFinish(result, arg, pt)
468
468
469
469
override def recheckApply (tree : Apply , pt : Type )(using Context ): Type =
470
- if tree.symbol == defn.cbnArg then
471
- recheckByNameArg(tree.args(0 ), pt)
472
- else
473
- includeCallCaptures(tree.symbol, tree.srcPos)
474
- super .recheckApply(tree, pt)
470
+ includeCallCaptures(tree.symbol, tree.srcPos)
471
+ super .recheckApply(tree, pt)
475
472
476
473
override def recheck (tree : Tree , pt : Type = WildcardType )(using Context ): Type =
477
474
val res = super .recheck(tree, pt)
Original file line number Diff line number Diff line change 5
5
6
6
def test (cap1 : Cap , cap2 : Cap ): {cap1} I =
7
7
def f () = if cap1 == cap1 then I () else I ()
8
- def h (x : => {cap1} I ) = x
8
+ def h (x : /* => */ {cap1} I ) = x // TODO: enable cbn
9
9
h(f())
10
10
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def foo(x: Boolean): Int throws Fail =
13
13
if x then 1 else raise(Fail ())
14
14
15
15
def handle [E <: Exception , R ](op : (erased CanThrow [E ]) -> R )(handler : E -> R ): R =
16
- erased val x : CanThrow [E ] = ???
16
+ erased val x : CanThrow [E ] = ??? : CanThrow [ E ]
17
17
try op(x)
18
18
catch case ex : E => handler(ex)
19
19
You can’t perform that action at this time.
0 commit comments