New Issue: Printing the type of a Chapel first class function should provide something useful

18728, "bmcdonald3", "Printing the type of a Chapel first class function should provide something useful", "2021-11-15T23:55:50Z"

Summary

Running this code:

proc myFunc(a: int) {
  return a + 1;
}
var f = myFunc;
writeln(f.type: string);

prints shared chpl__fcf_type_int64_t_int64_t, which is very obfuscated and can't be used to declare a variable with that as the type (e.g., var f: var f: chpl__fcf_type_int64_t_int64_t), which I would expect to be able to do with the type that is displayed to the user, similar to how when we print out the type of the class, we will see something like owned myClass.

David proposed something like proc(int): int, which I am in favor of.

Workarounds

To work around this issue when I needed to know the type of the FCF, I thought to do something like this:

proc dummyFunction(a: int): int {
  return a;
}
var f = dummyFunction;
var myFcf: f.type;

But that is not the ideal solution since it required me creating that dummy function for no reason besides getting the type I was looking for. I have been directed towards the func() function, but that doesn't seem intuitive to me either.