-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve error reporting around functions (#494)
Improve error reporting around functions This improves the error reporting around functions, such as arising from defun and defpurefun. Specifically, it highlights only the function name when there is a general error related to the function (e.g. its redeclared, etc).
- Loading branch information
1 parent
42d5ff0
commit 3aed5d4
Showing
7 changed files
with
36 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
;;error:3:1-29:symbol * already declared | ||
;;error:3:14-15:symbol * already declared | ||
;; Attempt to overload intrinsic. | ||
(defpurefun (* x y) (* x y)) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
;;error:4:1-50:symbol eq already declared | ||
;;error:4:14-16:symbol eq already declared | ||
;; Duplicate overload is always a syntax error. | ||
(defpurefun (eq (x :binary) (y :binary)) (- x y)) | ||
(defpurefun (eq (x :binary) (y :binary)) (+ x y)) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
;;error:4:1-25:symbol eq already declared | ||
;;error:4:9-11:symbol eq already declared | ||
;; Cannot overload pure with impure, and vice versa. | ||
(defpurefun (eq (x :binary) (y :binary)) (- x y)) | ||
(defun (eq x y) (+ x y)) |