We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.8
@scolobb reports on Discourse:
(define my-class% (class object% #:forall (A) (super-new) (init-field [x : A]) (define/public (get-x) x)))
I can define a synonym for the type of this class and then use it like so:
(define-type (MyClass% A) (Class (field (x A)) (get-x (-> A)))) (: a (Instance (MyClass% Boolean))) (define a (new (inst my-class% Boolean) [x #t])) (define-type (MyClassInstance A) (Instance (Class (field (x A)) (get-x (-> A)))))
but the following type alias causes an error
(define-type (MyClassInstance A) (Instance (MyClass% A)))
The type system shouldn't have complained.
; Type Checker: parse error in type; ; expected a class type for argument to Instance ; given: (MyClass% A) ; in: (Instance (MyClass% A))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Racket are you using?
8.8
What program did you run?
@scolobb reports on Discourse:
I can define a synonym for the type of this class and then use it like so:
but the following type alias causes an error
What should have happened?
The type system shouldn't have complained.
If you got an error message, please include it here.
; Type Checker: parse error in type;
; expected a class type for argument to Instance
; given: (MyClass% A)
; in: (Instance (MyClass% A))
The text was updated successfully, but these errors were encountered: