19893, "mppf", "Should the library provide cast from user records to string? ", "2022-05-27T01:47:42Z"
Today, given an arbitrary record (that hasn't defined a cast from the record to string), we can cast a value of that record to a string:
record R { var x: int; }
var r = new R(1);
var s: string = r:string;
writeln("Result of cast: ", s);
This does not seem to be mentioned anywhere in the language specification, at a quick glance.
The functionality is coming from this code in ChapelIO:
Which provides the ability to cast almost anything to string (just as we can writeln almost anything). I focused this issue on the user record case but it would also apply to user classes.
Should we keep (and stabilize) this feature? Or should we remove it?