CVS: sml-dist/src/compiler/Elaborator/types typecheck.sml, 1.8, 1.8.4.1

David MacQueen <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/compiler/Elaborator/types
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31177/src/compiler/Elaborator/types

Modified Files:
      Tag: primop-branch-2
	typecheck.sml 
Log Message:
added notes file for primop-branch-2 branch

Index: typecheck.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/compiler/Elaborator/types/typecheck.sml,v
retrieving revision 1.8
retrieving revision 1.8.4.1
diff -C2 -d -r1.8 -r1.8.4.1
*** typecheck.sml	8 Nov 2004 23:03:24 -0000	1.8
--- typecheck.sml	15 Jun 2006 22:28:07 -0000	1.8.4.1
***************
*** 12,18 ****
  
  
! (* functorized to factor out dependencies on FLINT... *)
! functor TypecheckFn (val ii_ispure : II.ii -> bool
! 		     val ii2ty : II.ii -> Types.ty option) : TYPECHECK =
  struct
  
--- 12,20 ----
  
  
! (* No longer functorized to factor out dependencies on FLINT (ii2ty, ii_ispure)
!  * Instead, TypesUtil depends directly on InlInfo -- it calls InlInfo.pureInfo to test
!  * for the CAST primop in function isValue. *)
! 
! structure Typecheck : TYPECHECK =
  struct
  
***************
*** 37,42 ****
  fun bug msg = ErrorMsg.impossible("TypeCheck: "^msg)
  
- val isValue = isValue { ii_ispure = ii_ispure }
- 
  infix 9 sub
  infix -->
--- 39,42 ----
***************
*** 267,270 ****
--- 267,273 ----
    
  
+ (* the VARpat case seems designed to ensure that only one variable in a pattern
+  * can have generalized type variables: either x or !tvs must be nil or a bug
+  * message is generated.  Why is this? [dbm] *)
  fun generalizePat(pat: pat, userbound: tyvar list, occ: occ, 
                    generalize: bool, region) =
***************
*** 406,422 ****
  in
       case exp
!       of VARexp(r as ref(VALvar{typ, info, ...}), _) =>
! 	 (case ii2ty info of
! 	      SOME st =>
!               let val (sty, insts) = instantiatePoly(st)
! 		  val (nty, _) = instantiatePoly(!typ)
!               in
! 		  unifyTy(sty, nty) handle _ => ();  (* ??? *)
! 		  (VARexp(r, insts), sty)
!               end
! 	    | NONE =>
! 	      let val (ty, insts) = instantiatePoly(!typ)
! 	      in (VARexp(r, insts), ty)
! 	      end)
         | VARexp(refvar as ref(OVLDvar _),_) =>
   	    (exp, ol_push (refvar, err region))
--- 409,416 ----
  in
       case exp
!       of VARexp(r as ref(VALvar{typ, ...}), _) =>
! 	  let val (ty, insts) = instantiatePoly(!typ)
! 	   in (VARexp(r, ty), ty)
! 	  end
         | VARexp(refvar as ref(OVLDvar _),_) =>
   	    (exp, ol_push (refvar, err region))
***************
*** 424,428 ****
         | CONexp(dcon as DATACON{typ,...},_) => 
             let val (ty,insts) = instantiatePoly typ
!             in (CONexp(dcon,insts),ty)
             end
         | INTexp (_,ty) => (oll_push ty; (exp,ty))
--- 418,422 ----
         | CONexp(dcon as DATACON{typ,...},_) => 
             let val (ty,insts) = instantiatePoly typ
!             in (CONexp(dcon,ty), ty)
             end
         | INTexp (_,ty) => (oll_push ty; (exp,ty))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.