-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
It should be possible to define a class hierarchy like this:
(coalton-toplevel
(define-class (HasA :t :a (:t -> :a))
(get-a (Proxy :t -> :a)))
(define-class (HasA :t :a => WrapsHasA :w :t (:w -> :t))
(get-two-as (:w -> Tuple :a :a)))
)Because, in the definition of WrapsHasA, :a can be determined by :t, that should be fully defined. Instead, Coalton forces WrapsHasA to also declare the inner type variable. Trying to compile the above gives this error:
error: Unknown type variable
--> test.lisp:6:25
|
6 | (define-class (HasA :t :a => WrapsHasA :w :t (:w -> :t))
| ^^ Unknown type variable :A
and the only fix is to also encode :a in WrapsHasA, like this:
(coalton-toplevel
(define-class (HasA :t :a (:t -> :a))
(get-a (Proxy :t -> :a)))
(define-class (HasA :t :a => WrapsHasA :w :t :a (:w -> :t))
(get-two-as (:w -> Tuple :a :a)))
)Metadata
Metadata
Assignees
Labels
No labels