Implement AST multi-error recovery - #383
Conversation
ad880be to
a378398
Compare
5b353a1 to
fdd2abb
Compare
fdd2abb to
5202cc8
Compare
|
In 763b2d8: I think we should call the The empty type has the properties you want -- it cannot be constructed, no code should ever be compiled which accepts it, and there is a unique function mapping it to every other type, and I'd like to add it to the language anyway, so we might as well add it here. In 8a1b03c: Adds a blank line to witness.rs, otherwise doesn't touch the file. |
4e826ec to
43e843e
Compare
43e843e to
759d71f
Compare
Changed
I accidentally refactored the code while reviewing it. Deleted it. |
759d71f to
08cf35a
Compare
08cf35a to
4a26413
Compare
4a26413 to
0d80370
Compare
| /// Nominal enum type, represented as a balanced sum of its variants' | ||
| /// payload types | ||
| Enum(EnumInfo), | ||
| /// Type of a recovered subtree. Compatible with every type; never re-reported. |
There was a problem hiding this comment.
In fdfae8b:
What is a "recovered subtree" what does it mean to "re-report" a type?
| .collect::<arbitrary::Result<Vec<Self>>>()?; | ||
| Ok(Self::list(elements, ty.as_ref().clone(), *bound)) | ||
| } | ||
| TypeInner::Never => unreachable!("cannot generate a value of a poisoned type"), |
There was a problem hiding this comment.
In fdfae8b:
This one is not unreachable. We should return an Arbitrary error here indicating that there is no value of the never type.
Analysis now reports every independent error in one pass instead of stopping at
the first.
Errorvariants in the parse tree, AST, and typesystem (
TypeInner::Error); recovery emits these instead of fabricated units,aliases, or sizes.
is_errorguardsand
ResolvedType::compatible), so one broken construct does not spawn secondaryerrors.
Scopecarries a diagnostics sink; containers recordan error and keep analyzing siblings, and
Program::analyzereturnsOption.parse_from_str(fragments, first error) vsparse_from_content(files, collect all), over one shared core.