User avatar
mhoye @mhoye@cosocial.ca
6mo
A thing I continue to not understand, or at least feel is a badly missed opportunity, about compilers is that they never seem to propose that you edit source directly from warnings.

"Warning: Implicit conversion from Foo to Bar" ok great, but why not, in that moment say "make explicit? (y/n)" and modify the text?
9
1
0
0
User avatar
🪨 @Varpie@peculiar.florist
6mo
@mhoye Because it's not the job of your compiler to update your code. And often, the resolution isn't as simple as a single yes/no choice, in your example for instance I'd argue it shouldn't even be a warning because the fact that it applied the implicit conversion suggests that there is an implicit operator defined to convert those types, which should be assumed to be safe, so it is a matter of taste more than correctness. Languages that value developer experience will provide a language server that can use those warnings to suggest code actions, so users can choose what they want to do in their code editor.
0
0
0
0