mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Function referencing in @return? for simplified fault declarations. Check @return? eagerly #2340.
This commit is contained in:
21
test/test_suite/contracts/contract_copy_optret.c3
Normal file
21
test/test_suite/contracts/contract_copy_optret.c3
Normal file
@@ -0,0 +1,21 @@
|
||||
module test;
|
||||
import std;
|
||||
|
||||
<*
|
||||
@return? test!
|
||||
*>
|
||||
fn void? test2()
|
||||
{
|
||||
return NOT_FOUND?;
|
||||
}
|
||||
<*
|
||||
@return? io::EOF, Foo!
|
||||
*>
|
||||
fn void? test()
|
||||
{
|
||||
return NOT_FOUND?;
|
||||
}
|
||||
<*
|
||||
@return? NOT_FOUND
|
||||
*>
|
||||
alias Foo = fn void();
|
||||
@@ -1,5 +1,5 @@
|
||||
module contract_err_tests;
|
||||
|
||||
import std;
|
||||
<*
|
||||
Hello world
|
||||
@param [in] a
|
||||
|
||||
Reference in New Issue
Block a user