-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Span to TermPos for patterns
Patterns were annotated with a span, which must always be a well-defined location in the source file. The implementation of full pattern matching - i.e. allowing match expression to have arbirary patterns on the left hand side of "=>" - showed that this is an issue, because the enum contract is implemented using match, and thus generate a match expression without a definite position. This commit switches to optional position instead, delaying the fearful `pos.unwrap()` to the latest moment possible, when we need to generate a contract and build a `Label` during a pattern destructuring, which shouldn't affect the contract-generated match expressions.
- Loading branch information
Showing
2 changed files
with
27 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters