`&&', the bitwise operators, the shifts and `++' each stopped with `cannot infer'; an array operand came back as the array; a rank tie went to whichever operand came first; and a toplevel `_' reached the writer unsolved.
46 lines
961 B
Scheme
46 lines
961 B
Scheme
(module infer
|
|
(;; The IR
|
|
tvar?
|
|
tvar-id
|
|
tvar-classes
|
|
tvar-rigid?
|
|
fresh-tvar
|
|
fresh-rigid-tvar
|
|
|
|
prim-type? prim-name prim-quals make-prim
|
|
ptr-type? ptr-target ptr-quals make-ptr
|
|
array-type? array-elt array-size make-array-type
|
|
fn-type? fn-ret fn-args fn-variadic? make-fn-type
|
|
agg-type? agg-kind agg-name agg-spelling agg-quals make-agg
|
|
alias-type? alias-name alias-expansion alias-quals make-alias
|
|
unknown-type? the-unknown-type
|
|
|
|
resolve
|
|
underlying
|
|
c-primitive?
|
|
type-quals
|
|
free-tvars
|
|
decay
|
|
|
|
;; The boundary
|
|
parse-type
|
|
unparse-type
|
|
|
|
;; Constraints
|
|
register-class!
|
|
add-instance!
|
|
entails?
|
|
default-tvar!
|
|
default-type-variables!
|
|
|
|
;; Unification
|
|
unify
|
|
|
|
;; Type schemes
|
|
scheme? scheme-vars scheme-constraints scheme-type
|
|
make-scheme
|
|
generalize
|
|
instantiate
|
|
substitute)
|
|
"../infer.scm")
|