[Nice-commit] Nice/src/nice/tools/typing Types.java,1.14,1.15
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2005-05-24 19:15:08
|
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); } } |