Skip to content

Commit

Permalink
Remove check of class constraints for specialization
Browse files Browse the repository at this point in the history
The original code rejects specializing a function/variable of type without
class constraints.  That restriction seems unecessary.
  • Loading branch information
shirok committed Oct 3, 2024
1 parent 4394ae4 commit 83dccb7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/typechecker/specialize.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@
(let ((from-qual-ty (tc:fresh-inst from-ty))
(to-qual-ty (tc:fresh-inst to-ty)))

(when (null (tc:qualified-ty-predicates from-qual-ty))
(tc-error "Invalid specialization"
(tc-note (parser:toplevel-specialize-from specialize)
"must be a function or variable with class constraints")))
;; NB: There used to be a check if from-ty contains predicates, and raises an
;; error if not. It doesn't seem necessary.

(unless (equalp to-ty scheme)
(tc-error "Invalid specialization"
Expand Down

0 comments on commit 83dccb7

Please sign in to comment.