Hi.
Long story short, I have some custom types in my code and if I do @code_warntype
on the functions that use them I see them in red. Nothing else is red, there are no Any
or weird unions, just the color of the structures is red. I am attaching a picture, because copying the code here and formatting it loses the red color.
Main question: Should I care? I don’t think I have any performance issues.
A bit longer story:
I am not sure I can give a MWE, but I hope that I could get some help in spite of that.
I have the following nested structure
| f#1
Main entry function, gets generic input
| _> f#2
second function takes this input and depending on it dispatches to different models
| ___> f#3
main function, where the magic happens
I have defined custom types whose instances get generated in f#1, depending on user input.
If I run @code_warntype
on f#1 I get my custom types in red. Nothing else. No Any or other problems.
If I rewrite the nested functions, such that I desn’t utilize the custom types and dipstach, the red color disappears. If I then @btime
both the code above (the nested functions) that gives red colors versus the one without I get identical times.
Also, the main function that does the calculation is always type stable according to @code_warntype
, and this is where the whole program essentially runs.