diff options
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/fail_compilation/assign_procedure.elna | 11 | ||||
| -rw-r--r-- | testsuite/runnable/procedure_cast.elna | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/testsuite/fail_compilation/assign_procedure.elna b/testsuite/fail_compilation/assign_procedure.elna new file mode 100644 index 0000000..7d69724 --- /dev/null +++ b/testsuite/fail_compilation/assign_procedure.elna @@ -0,0 +1,11 @@ +module + +proc f() +return + +proc g() +begin + f := g (* @Error Cannot assign to a value of type 'proc\(\)', because it is constant or contains constant members *) +return + +end. diff --git a/testsuite/runnable/procedure_cast.elna b/testsuite/runnable/procedure_cast.elna index 191afbf..d724e38 100644 --- a/testsuite/runnable/procedure_cast.elna +++ b/testsuite/runnable/procedure_cast.elna @@ -1,11 +1,11 @@ program() var - cb: proc(x: ^Char) -> Int + cb: ^proc(x: ^Char) -> Int proc probe_int(x: ^Int) -> Int return 42 begin - cb := cast(probe_int: proc(x: ^Char) -> Int); - assert(cb(nil) = 42) + cb := cast(@probe_int: ^proc(x: ^Char) -> Int); + assert(cb^(nil) = 42) end. |
