racket/typed-racket

internal error type-checking a dot type program

Offen

#509 geöffnet am 13.03.2017

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Racket (106 Forks)github user discovery
good first issue

Repository-Metriken

Stars
 (576 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 11T 14h) (1 gemergte PR in 30 T)

Beschreibung

What version of Racket are you using?

6.8.0.2--2017-02-10

What program did you run?

#lang typed/racket

(define-type Filter
  (All (a b ...) (-> (-> a b ... b Any) (Listof a) (Listof b) ... (Listof a))))

(: filter* Filter)
(define (filter* p? l)
  (cond
    [(andmap empty? l) '[]]
    [else (define fst ({inst map a b ...} first l))
          (define rst (apply filter* p? ({inst map a b ...} rest l)))
          (if (apply p? fst) (cons fst rst) rst)]))

(filter* (lambda ({x : Integer}) (> x 1)) '(0 1 2))

What should have happened?

type error

If you got an error message, please include it here.

plt/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:271:0: Internal Typechecker Error: Got non-dcons: #(struct:dcon-dotted () #(struct:c Nothing b) b) #(struct:dcon-exact () #(struct:c Nothing Any)) while typechecking: (#%app apply filter* p? (#%app (#%expression map) rest l)) originally: (apply filter* p? ((inst map a b ...) rest l))

Contributor Guide