diff --git a/control-flow-linearity-in-Links.md b/control-flow-linearity-in-Links.md index ea4cbae64..273c13041 100644 --- a/control-flow-linearity-in-Links.md +++ b/control-flow-linearity-in-Links.md @@ -115,10 +115,8 @@ fun : (a::Any) {L:() =@ ()|_::Lin}-> a::Any ## Compatibility -* Compatible with all previous handler tests (except part of - polymorphic operations and effect sugar). -* Not entirely compatible with FreezeML, SessionFail, etc. -* Passes all tests with the flag disabled, except - * `!FAILURE: Operation polymorphism (2)` - * `!FAILURE: Operation polymorphism (3)` - * `!FAILURE: Typecheck example file examples/handlers/monadic_reflection.links` +* Passes all previous tests with the flag disabled. +* Passes all previous effect handler tests with the flag enabled, including + * `/tests/handlers_with_cfl_on.tests`, and + * `/tests/typecheck_examples_with_cfl_on.tests`. +* Not entirely compatible with FreezeML, SessionFail, etc. (?) \ No newline at end of file diff --git a/tests/control_flow_linearity.tests b/tests/control_flow_linearity.tests index e9116e7d4..446a6e553 100644 --- a/tests/control_flow_linearity.tests +++ b/tests/control_flow_linearity.tests @@ -1,85 +1,88 @@ +--- +config: tests/control_flow_linearity.config +--- + Use linear variables in deep handlers (1) tests/handlers/lin_deep1.links filemode : true exit : 1 stderr : @.*Type error: Variable .* of linear type .* is used in a deep handler.* -args : --enable-handlers --track-control-flow-linearity + Use linear variables in deep handlers (2) tests/handlers/lin_deep2.links filemode : true exit : 1 stderr : @.*Type error: Variable .* of linear type .* is used in a deep handler.* -args : --enable-handlers --track-control-flow-linearity + Use linear variables in deep handlers (3) tests/handlers/lin_deep3.links filemode : true exit : 1 stderr : @.*Type error: Variable .* has linear type .* is used .* times.* -args : --enable-handlers --track-control-flow-linearity + Use linear variables in deep handlers (4) tests/handlers/lin_deep4.links filemode : true exit : 1 stderr : @.*Type error: Variable .* of linear type .* is used in a deep handler.* -args : --enable-handlers --track-control-flow-linearity + Linear operation and continuation handle (lindo Foo(20) + 1) {case -> xlin; k(i)} stdout : 21 : Int -args : --enable-handlers --track-control-flow-linearity + Non-linear operation and continuation handle (do Foo(20) + 1) {case k> -> k(i) + k(i)} stdout : 42 : Int -args : --enable-handlers --track-control-flow-linearity + Use linear variable in linear continuation {linfun f(x) {40+x} handle ({xlin; f(lindo Foo)}) {case -> xlin; k(2)}} stdout : 42 : Int -args : --enable-handlers --track-control-flow-linearity + Use linear variable in non-linear continuation {linfun f(x) {x} handle (f(do Foo)) {case k> -> k(1)}} exit : 1 stderr : @.*Type error: Variable .* of linear type .* is used in a non-linear continuation.* -args : --enable-handlers --track-control-flow-linearity + Operation annotation fun(m) { xlin; handle(m()) { case : ((Int) =@ Int) -> xlin; k (x) } } stdout : fun : (() {Foo:(Int) =@ Int|a::Lin}~> b::Any) {Foo{_::Lin}|a::Lin}~> b::Any -args : --enable-handlers --track-control-flow-linearity + New implementation of examples/handlers/choose.links tests/handlers/new_choose.links filemode : true stdout : [10, 10, 18, 12, 20] : [Int] -args : --enable-handlers --track-control-flow-linearity + Combine unlimited choice and state tests/handlers/choose_and_state.links filemode : true stdout : [3, 4, 9, 10, 3, 3, 3, 3] : [Int] -args : --enable-handlers --track-control-flow-linearity + Combine linear choice and unlimited state tests/handlers/choose_and_state2.links filemode : true stdout : 3 : Int -args : --enable-handlers --track-control-flow-linearity + Check the first part of Issue 544 tests/handlers/issue544a.links filemode : true exit : 1 stderr : @.*Type error: Effect row type .* can not be made linear .* -args : --enable-handlers --track-control-flow-linearity + Check the second part of Issue 544 tests/handlers/issue544b.links filemode : true exit : 1 stderr : @.*Type error: Effect row type .* can not be made linear .* -args : --enable-handlers --track-control-flow-linearity \ No newline at end of file diff --git a/tests/typecheck_examples_with_cfl_on.tests b/tests/typecheck_examples_with_cfl_on.tests index 7f42b174a..753c58f9a 100644 --- a/tests/typecheck_examples_with_cfl_on.tests +++ b/tests/typecheck_examples_with_cfl_on.tests @@ -2,6 +2,8 @@ config: tests/examples_default_with_cfl_on.config --- +# Only include the files in examples/handlers + Typecheck example file examples/handlers/alert.links examples/handlers/alert.links filemode : true