Cannot use otherwise bound names as type variables

Issue #9 closed
Stephen Chang repo owner created an issue

example:

#lang mlish

(define-type (Test X)
  (A X))

(define (f [x : (Test A)] -> (Test A)) 
  x)

Rather than using the A in f's signature as a type variable, it thinks it refers to the A constructor and produces the error:

; TYPE-ERROR: tmp.mlish (6:22): constructor A must instantiate 1 type argument(s): X
; and be applied to 1 arguments with type(s): X

There may not be anything I can do about this, unless type variables are further distinguished somehow.

Comments (1)

  1. Stephen Chang reporter

    infer quantified type variables in the order that they occur (L-to-R)

    • backwards incompatible change: quantified type variables no longer sorted lex
    • fix and add tests, remove some annotations in tests
    • small speed improvement due to eliminating some extra expansions
    • closes #9, closes #11

    → <<cset c64251cac0e8>>

  2. Log in to comment