Switch subtype to use infer.ss for unification.
original commit: 606ef69d205499ad6071d3a0e1d228938c5299b1
This commit is contained in:
parent
f9708ff850
commit
9e78ce0847
|
@ -1,6 +1,6 @@
|
|||
#lang scheme/base
|
||||
|
||||
(require "type-rep.ss" "unify.ss" "union.ss" "subtype.ss"
|
||||
(require "type-rep.ss" "union.ss" "subtype.ss"
|
||||
"type-utils.ss" "resolve-type.ss" "type-effect-convenience.ss"
|
||||
mzlib/plt-match mzlib/trace)
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#lang scheme/base
|
||||
|
||||
(require (except-in "type-rep.ss" sub-eff) "unify.ss" "type-utils.ss"
|
||||
(require (except-in "type-rep.ss" sub-eff) "type-utils.ss"
|
||||
"tc-utils.ss"
|
||||
"effect-rep.ss"
|
||||
"type-comparison.ss"
|
||||
"resolve-type.ss"
|
||||
"type-name-env.ss"
|
||||
(only-in "infer-dummy.ss" unify)
|
||||
mzlib/plt-match
|
||||
mzlib/trace)
|
||||
|
||||
|
@ -197,7 +198,7 @@
|
|||
;; use unification to see if we can use the polytype here
|
||||
[(list (Poly: vs b) s)
|
||||
(=> unmatch)
|
||||
(if (unify1 s b) A0 (unmatch))]
|
||||
(if (unify vs (list b) (list s)) A0 (unmatch))]
|
||||
[(list s (Poly: vs b))
|
||||
(=> unmatch)
|
||||
(if (null? (fv b)) (subtype* A0 s b) (unmatch))]
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
"private/type-name-env.ss"
|
||||
"private/type-alias-env.ss"
|
||||
"private/utils.ss"
|
||||
(only-in "private/infer-dummy.ss" infer-param)
|
||||
"private/infer.ss"
|
||||
"private/type-effect-convenience.ss"
|
||||
"private/type-contract.ss"
|
||||
scheme/nest
|
||||
|
@ -47,7 +49,10 @@
|
|||
[with-handlers
|
||||
([(lambda (e) (and catch-errors? (exn:fail? e) (not (exn:fail:syntax? e))))
|
||||
(lambda (e) (tc-error "Internal error: ~a" e))])]
|
||||
[parameterize ([delay-errors? #t]
|
||||
[parameterize (;; a cheat to avoid units
|
||||
[infer-param infer]
|
||||
;; do we report multiple errors
|
||||
[delay-errors? #t]
|
||||
;; this parameter is for parsing types
|
||||
[current-tvars initial-tvar-env]
|
||||
;; this parameter is just for printing types
|
||||
|
@ -93,7 +98,9 @@
|
|||
[(_ . form)
|
||||
(nest
|
||||
([begin (set-box! typed-context? #t)]
|
||||
[parameterize (;; this paramter is for parsing types
|
||||
[parameterize (;; a cheat to avoid units
|
||||
[infer-param infer]
|
||||
;; this paramter is for parsing types
|
||||
[current-tvars initial-tvar-env]
|
||||
;; this parameter is just for printing types
|
||||
;; this is a parameter to avoid dependency issues
|
||||
|
|
Loading…
Reference in New Issue
Block a user