How to check two function type matches?

/// 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?

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