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 authored and stylewarning committed Oct 4, 2024
1 parent e80aef6 commit ab5f6ab
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 ab5f6ab

Please sign in to comment.