- Distinct func type would not accept direct function address assign. #1287

This commit is contained in:
Christoffer Lerno
2024-08-01 16:26:50 +02:00
parent 310dadef45
commit 10058cf271
3 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
module output;
def FnA = fn void(int*);
distinct FnB = FnA;
fn void func(int*) {}
fn void main()
{
FnA a = &func;
FnB b = (FnB)&func;
FnB b2 = &func;
FnB b3 = fn (int* x) {};
}