racket / racket/typed-racket

custom events require casting

Open
#167 1 comment 0 reactions 1 assignee View on GitHub

@capfredf is already working on this.

Since Apr 8, 2021.

Dominant language
Racket
Stars
575
Forks
106
Avg merge
2h 1m
Merged PRs (30d)
2

Description

Custom events cannot be supplied to sync. For example:

-> (struct: (a) reply
     ((evt : (Evtof a)))
     #:property prop:evt (struct-field-index evt))
-> (sync (reply always-evt))
; readline-input:4:0: Type Checker: Polymorphic function `sync' could not be
;   applied to arguments:
; Domain: (Evtof a) *
; Arguments: (reply (Rec x (Evtof x)))
;   in: (sync (reply always-evt))
; [,bt for context]
-> (sync (cast (reply always-evt) (Rec x (Evtof x))))
- : (Rec x (Evtof x))
#<always-evt>

On the other hand, some well-known non-pure-evt types seem to work fine.

-> (sync (current-input-port))
- : Input-Port
#<input-port:readline-input>

Help?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.