File tree 4 files changed +5
-7
lines changed
compiler/src/dotty/tools/dotc
tests/pos-custom-args/captures
4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1402,6 +1402,7 @@ class Definitions {
1402
1402
funTypeArray(funTypeIdx(isContextual, isErased, isImpure))(n).symbol
1403
1403
1404
1404
@ tu lazy val Function0_apply : Symbol = Function0 .requiredMethod(nme.apply)
1405
+ @ tu lazy val ContextFunction0_apply : Symbol = ContextFunction0 .requiredMethod(nme.apply)
1405
1406
1406
1407
@ tu lazy val Function0 : Symbol = FunctionSymbol (0 )
1407
1408
@ tu lazy val Function1 : Symbol = FunctionSymbol (1 )
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