FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.58k stars 5.37k forks source link

Review and simplify existing errors and warnings before turning them into expressive diagnostics #4985

Open ironcev opened 1 year ago

ironcev commented 1 year ago

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

ironcev commented 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.

ironcev commented 1 year ago

Review and add these:

image