Files
c3c/test/test_suite/lambda/lambda_checks.c3
Christoffer Lerno 8b49e6c14d Rename def to alias.
2025-03-13 11:22:27 +01:00

14 lines
375 B
Plaintext

module test;
alias Func = fn void (bool);
fn bool foo (String) => true;
fn void bar(Func func) => func(false);
fn void main()
{
Func funcX = &foo; // #error: Implicitly casting
bar(&foo); // #error: Implicitly casting
Func func = fn bool (String) { return true; }; // #error: which doesn't match
bar(fn bool (String) { return true; }); // #error: which doesn't match
}