Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/branches/primop-branch/src/compiler/Elaborator/types/typecheck.sml
ViewVC logotype

Diff of /sml/branches/primop-branch/src/compiler/Elaborator/types/typecheck.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1377, Tue Sep 16 15:22:47 2003 UTC revision 1475, Fri Apr 9 19:05:33 2004 UTC
# Line 11  Line 11 
11  end (* signature TYPECHECK *)  end (* signature TYPECHECK *)
12    
13    
14  (* functorized to factor out dependencies on FLINT... *)  (* No longer functorized to factor out dependencies on FLINT (ii2ty, ii_ispure)
15  functor TypecheckFn (val ii_ispure : II.ii -> bool   * Instead, TypesUtil depends directly on InlInfo -- it calls InlInfo.pureInfo to test
16               (* PRIMOP: val ii2ty : II.ii -> Types.ty option *)) : TYPECHECK =   * for the CAST primop in function isValue. *)
17    
18    structure Typecheck : TYPECHECK =
19  struct  struct
20    
21  local open Array List Types VarCon BasicTypes TypesUtil Unify Absyn  local open Array List Types VarCon BasicTypes TypesUtil Unify Absyn
# Line 37  Line 39 
39    
40  fun bug msg = ErrorMsg.impossible("TypeCheck: "^msg)  fun bug msg = ErrorMsg.impossible("TypeCheck: "^msg)
41    
 val isValue = isValue { ii_ispure = ii_ispure }  
   
42  infix 9 sub  infix 9 sub
43  infix -->  infix -->
44    
# Line 264  Line 264 
264    | generalizeTy _ = bug "generlizeTy - bad arg"    | generalizeTy _ = bug "generlizeTy - bad arg"
265    
266    
267    (* the VARpat case seems designed to ensure that only one variable in a pattern
268     * can have generalized type variables: either x or !tvs must be nil or a bug
269     * message is generated.  Why is this? [dbm] *)
270  fun generalizePat(pat: pat, userbound: tyvar list, occ: occ,  fun generalizePat(pat: pat, userbound: tyvar list, occ: occ,
271                    generalize: bool, region) =                    generalize: bool, region) =
272      let val tvs : tyvar list ref = ref []      let val tvs : tyvar list ref = ref []
# Line 405  Line 408 
408       case exp       case exp
409        of VARexp(r as ref(VALvar{typ, ...}), _) =>        of VARexp(r as ref(VALvar{typ, ...}), _) =>
410            let val (ty, insts) = instantiatePoly(!typ)            let val (ty, insts) = instantiatePoly(!typ)
411             in (VARexp(r, insts), ty)             in (VARexp(r, ty), ty)
412            end            end
413    
414         | VARexp(refvar as ref(OVLDvar _),_) =>         | VARexp(refvar as ref(OVLDvar _),_) =>

Legend:
Removed from v.1377  
changed lines
  Added in v.1475

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0