Nice/src/nice/tools/typing Types.java,1.14,1.15

Daniel Bonniot <[email protected]> Tue, 24 May 2005 19:14:59 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/src/nice/tools/typing
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29140/src/nice/tools/typing

Modified Files:
	Types.java 
Log Message:
Fix mergings involving the Object type.


Index: Types.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/typing/Types.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Types.java	8 Mar 2005 19:33:22 -0000	1.14
--- Types.java	24 May 2005 19:14:56 -0000	1.15
***************
*** 403,408 ****
        return m1;
  
!     Monotype raw1 = equivalent(m1);
!     Monotype raw2 = equivalent(m2);
  
      TypeConstructor head;
--- 403,430 ----
        return m1;
  
!     Monotype raw = rawMerge(equivalent(m1), equivalent(m2));
!     if (raw == null)
!       return null;
! 
!     TypeConstructor marker;
!     if (isSure(m1) && isSure(m2))
!       marker = PrimitiveType.sureTC;
!     else
!       marker = PrimitiveType.maybeTC;
! 
!     Monotype res = new MonotypeConstructor(marker, new Monotype[]{raw});
!     return res;
!   }
! 
!   private static Monotype rawMerge(Monotype raw1, Monotype raw2)
!   {
!     if (raw1 == raw2)
!       return raw1;
! 
!     if (raw1 == TopMonotype.instance || raw2 == TopMonotype.instance)
!       return TopMonotype.instance;
! 
!     TypeConstructor head1 = raw1.head();
!     TypeConstructor head2 = raw2.head();
  
      TypeConstructor head;
***************
*** 432,444 ****
        }
  
!     Monotype raw = new MonotypeConstructor(head, args);
! 
!     TypeConstructor marker;
!     if (isSure(m1) && isSure(m2))
!       marker = PrimitiveType.sureTC;
!     else
!       marker = PrimitiveType.maybeTC;
! 
!     return new MonotypeConstructor(marker, new Monotype[]{raw});
    }
  }
--- 454,458 ----
        }
  
!     return new MonotypeConstructor(head, args);
    }
  }



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005