File tree Expand file tree Collapse file tree 4 files changed +5
-7
lines changed
compiler/src/dotty/tools/dotc
tests/pos-custom-args/captures Expand file tree Collapse file tree 4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1402,6 +1402,7 @@ class Definitions {
14021402 funTypeArray(funTypeIdx(isContextual, isErased, isImpure))(n).symbol
14031403
14041404 @ tu lazy val Function0_apply : Symbol = Function0 .requiredMethod(nme.apply)
1405+ @ tu lazy val ContextFunction0_apply : Symbol = ContextFunction0 .requiredMethod(nme.apply)
14051406
14061407 @ tu lazy val Function0 : Symbol = FunctionSymbol (0 )
14071408 @ 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:
467467 recheckFinish(result, arg, pt)
468468
469469 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)
475472
476473 override def recheck (tree : Tree , pt : Type = WildcardType )(using Context ): Type =
477474 val res = super .recheck(tree, pt)
Original file line number Diff line number Diff line change 55
66def test (cap1 : Cap , cap2 : Cap ): {cap1} I =
77 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
99 h(f())
1010
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def foo(x: Boolean): Int throws Fail =
1313 if x then 1 else raise(Fail ())
1414
1515def 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 ]
1717 try op(x)
1818 catch case ex : E => handler(ex)
1919
You can’t perform that action at this time.
0 commit comments