-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show pattern and expression applications in infix in error messages
Record whether a pattern or expression application originated from an infix application and layout such patterns and expressions as appropriate, so that error messages appear as they are written in the source file. Consider the program (with type errors): datatype t = $ of int * int infix $ val _ = case 1 $ 1 of true $ false => false val _ = 1 + 2.0 + "b" + true Previously, the error messages were: Error: z.sml 3.24-3.35. Constructor applied to incorrect argument in pattern. expects: [int] * [int] but got: [bool] * [bool] in: $ (true, false) Error: z.sml 4.9-4.15. Function applied to incorrect argument. expects: _ * [int] but got: _ * [real] in: + (1, 2.0) Error: z.sml 4.9-4.21. Function applied to incorrect argument. expects: _ * [int] but got: _ * [string] in: + (+ (1, 2.0), "b") Error: z.sml 4.9-4.28. Function applied to incorrect argument. expects: _ * [int] but got: _ * [bool] in: + (+ (+ (1, 2.0), "b"), true) Now, the error messages are: Error: z.sml 3.24-3.35. Constructor applied to incorrect argument in pattern. expects: [int] * [int] but got: [bool] * [bool] in: true $ false Error: z.sml 4.9-4.15. Function applied to incorrect argument. expects: _ * [int] but got: _ * [real] in: 1 + 2.0 Error: z.sml 4.9-4.21. Function applied to incorrect argument. expects: _ * [int] but got: _ * [string] in: (1 + 2.0) + "b" Error: z.sml 4.9-4.28. Function applied to incorrect argument. expects: _ * [int] but got: _ * [bool] in: ((1 + 2.0) + "b") + true
- Loading branch information
1 parent
1d50642
commit f41ca5e
Showing
6 changed files
with
65 additions
and
27 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