unisgn

July 17, 2026, 1:04pm 1

/// return true if
/// a = b; // a: Afunc, b: Bfunc
/// won’t cause a compile error
fn match_function_type(Afunc: type, Bfunc: type) bool

simply Afunc == Bfunc is not all the cases.

by the way, is there a way to capture the compile error?

PinieP July 17, 2026, 2:14pm 2

You can check if the functions have the same function pointer type:
@TypeOf(&a) == @TypeOf(&b)