-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve runtime errors on invalid type-mismatched Elm record access
Improve errors in scenarios where Elm syntax was compiled with incomplete type-checking, resulting in an invalid record access using a nonexistent field name. In the previous version, such a program caused a stack overflow. The changes in this commit improve the errors as follows: + Expand the framework for testing using Elm Interactive scenarios to support expectations for errors: Add a syntax to encode the expected contents of an error in a test scenario step and adapt the processing of step results accordingly. + Change the PineVM implementation to include more details when crashing due to failed parsing of a value as expression: Include details on both function value and environment. + Change the Elm compiler to crash by invalid parsing instead of the infinite recursion used earlier. Use the function and environment properties of the parse-and-eval expression to specify the error, including the name of the searched record field.
- Loading branch information
Showing
8 changed files
with
107 additions
and
45 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
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
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
1 change: 1 addition & 0 deletions
1
...est-and-train/elm-interactive-scenarios-core/errors/steps/131/expected-error-contains.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invalid record access |
4 changes: 4 additions & 0 deletions
4
implement/test-and-train/elm-interactive-scenarios-core/errors/steps/131/submission.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let | ||
theRecord = { alpha = 1, beta = 2 } | ||
in | ||
theRecord.gamma |