Add "Dealing With Common Errors" to Appendix
When I was new to Pony, errors like Array[I32 val] ref is not a subtype of Array[I32 val] val: ref is not a subtype of val were a bit confusing, and I had trouble figuring out how to resolve them.
Most of my problems revolved around things related to reference capabilities, and I think that's probably going to be the case for most new people coming to Pony, because that's one of the big things that Pony has and that other languages lack.
I'd imagine something with:
- an example error message
- a quick explanation of what's happening
- some example code that triggers the error
- some example code that fixes the error
- a link to the relevant part of the documentation to learn more
I'd maybe start with these errors:
-
receiver type is not a subtype of target type -
right side must be a subtype of left side -
function body isn't the result type
I think it would also be worth going into some detail about what these messages are trying to indicate:
-
[A] [cap1] is not a subtype of [A] [cap2]: [cap1] is not a subtype of [cap2](whereAis a type andcap1andcap2are different reference capabilities) -
[A] [cap1] is not a subtype of [A] [cap1] !: [cap1] is not a subtype of [cap1] !(whereAis a type andcap1is a reference capability)
I'm willing to do the work here if anyone else thinks this is a good idea. I'd like to get some feedback on it before I go off and do it.
i like the general idea although i wonder if effort would be better spent improving the compiler error messages and where possible have them recommend fixes (ala elm)
We have this partially in place now. I kind of feel like this should be moved out of the appendix and onto a more prominent position on the website. Thoughts?
@aturley and @SeanTAllen What is the renewed state of this issue? From my view, the underlying confusion is addressable both from improving ponyc errors and in a Tutorial "common error" resolution section.