Nice/src/mlsub/typing/lowlevel Engine.java,1.38,1.39

Daniel Bonniot <[email protected]> Tue, 21 Jun 2005 18:31:01 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21791/src/mlsub/typing/lowlevel

Modified Files:
	Engine.java 
Log Message:
Handle setting the unknown flag on monotype variables that have been frozen.


Index: Engine.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** Engine.java	17 Jun 2005 14:14:08 -0000	1.38
--- Engine.java	21 Jun 2005 18:30:59 -0000	1.39
***************
*** 533,557 ****
  		  {
  		    s.push(leq.e2);
  		  }
  		else
  		  {
! 		    if(leq.e1.getKind()!=leq.e2.getKind())
! 		      throw new InternalError("Bad kinding in Engine.setKind 1");
! 		    i.remove();
! 		    k.leq(leq.e1,leq.e2,initialContext);
! 		  }
  	      else if(leq.e2==e)
                  // If e is Top, e1 <: e is trivial and can be discarded.
                  if (toTop)
!                   i.remove();
                  else if (leq.e1.getKind() == null)
! 		  s.push(leq.e1);
  		else
  		  {
! 		    if(leq.e1.getKind()!=leq.e2.getKind())
! 		      throw new InternalError("Bad kinding in Engine.setKind 2");
! 		    i.remove();
! 		    k.leq(leq.e1,leq.e2,initialContext);
! 		  }
  	    }
  	}
--- 533,579 ----
  		  {
  		    s.push(leq.e2);
+                     continue;
  		  }
  		else
  		  {
!                     // General case later
!                   }
  	      else if(leq.e2==e)
                  // If e is Top, e1 <: e is trivial and can be discarded.
                  if (toTop)
!                   {
!                     i.remove();
!                     continue;
!                   }
                  else if (leq.e1.getKind() == null)
! 		  {
!                     s.push(leq.e1);
!                     continue;
!                   }
  		else
  		  {
!                     // General case later
!                   }
!               else
!                 continue;
! 
!               // General case, add leq.e1 <: leq.e2
!               if (leq.e1.getKind() != leq.e2.getKind())
!                 throw new InternalError("Bad kinding in Engine.setKind");
! 
!               if (leq.e1 instanceof mlsub.typing.Monotype &&
!                   leq.e2 instanceof mlsub.typing.Monotype)
!                 {
!                   mlsub.typing.Monotype e1 = (mlsub.typing.Monotype) leq.e1;
!                   mlsub.typing.Monotype e2 = (mlsub.typing.Monotype) leq.e2;
! 
!                   if (e1.isUnknown())
!                     e2.setUnknown(false, true);
!                   else if (e2.isUnknown())
!                     e1.setUnknown(true, false);
!                 }
! 
!               i.remove();
!               k.leq(leq.e1,leq.e2,initialContext);
  	    }
  	}



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click