Open ironcev opened 1 year ago
Review and add these (taken from https://github.com/FuelLabs/sway-rfcs/pull/30#issuecomment-1684253622):
Here are some classes of errors that could probably be represented with 1 diagnostic type.
DeclIsNotAX
and NotAX
ImportPrivateX
UnknownX
MultipleDefinitionsOfX
Unimplemented
and UnimplementedWithHelp
- should there always be a help?XNotAPartOfInterfaceSurface
DoesNotTakeTypeArgumentsX
and TypeArgumentsNotAllowed
ImmediateXTooLarge
UnknownType
and UnknownTypeName
RecursiveType
and RecursiveTypeChain
XFromExternalContext
Review and add these:
As proposed by @sdankel in this RFC comment, before switching to new diagnostics, let's use the opportunity and see if we can simplify and cut down the number of warnings and errors we have at the moment, while at the same time increasing their expressiveness.
Let's keep this issue and this description as the documentation of the mappings from existing errors/warnings to new ones. Please add proposals in comments below and we will integrate them here to have a complete list and track the progress once we start the transition to diagnostics.
We have the following diagnostic areas that we want to cover:
Lexical analysis
Parsing
Parse tree conversion
Type checking
Semantic analysis
Warnings