You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the compiler v10, since the variant outputs were an integer and were not able to customized, we added the original name as a comment as a hint. e.g.
typet=
| A
| B
| Unknownlettest= (t) =>switcht {
| "A"=>A
| "B"=>B
| _=>Unknown
}
generated
functiontest(t){switch(t){case"A" :
return/* A */0;case"B" :
return/* B */1;default:
return/* Unknown */2;}}
I liked those little comments when debugging the output directly. But starting from v11 we no longer print comments on there.
Sometimes, I still make some integer variants for (size and perf) optimization, but the presence or absence of comments greatly affects my debugging experience.
So I suggest that any comments explicitly entered by the user are copied as-is to the output, so:
typet=
| @as(/* leading comment and some space between */0) A
| @as(1/*also trailing comment*/) B
| Unknown
will produce:
functiontest(t){switch(t){case"A" :
return/* leading comment and some space between */0;case"B" :
return1/*leading comment and some space between*/;default:
return"Unknown";}}
That means it can be truly "customizable" output
The text was updated successfully, but these errors were encountered:
In the compiler v10, since the variant outputs were an integer and were not able to customized, we added the original name as a comment as a hint. e.g.
generated
I liked those little comments when debugging the output directly. But starting from v11 we no longer print comments on there.
Sometimes, I still make some integer variants for (size and perf) optimization, but the presence or absence of comments greatly affects my debugging experience.
So I suggest that any comments explicitly entered by the user are copied as-is to the output, so:
will produce:
That means it can be truly "customizable" output
The text was updated successfully, but these errors were encountered: