[Nice-commit] Nice/src/bossa/syntax NewArrayExp.java,1.22,1.23
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-07-21 20:26:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20768/src/bossa/syntax Modified Files: NewArrayExp.java Log Message: Handle creation of arrays with a parameterized type component (which was broken by the new handling of type variables in 0.9.8). Index: NewArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NewArrayExp.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** NewArrayExp.java 16 Apr 2004 13:55:29 -0000 1.22 --- NewArrayExp.java 21 Jul 2004 20:26:14 -0000 1.23 *************** *** 80,83 **** --- 80,85 ---- nullVars = null; + MonotypeVar[] typeVars = null; + // Whether the element are surely not null boolean sure = false; *************** *** 102,106 **** TypeConstructor tc = (TypeConstructor) resolvedType; ! monotype = new MonotypeConstructor(tc, MonotypeVar.news(tc.arity())); if (Types.isPrimitive(tc)) --- 104,110 ---- TypeConstructor tc = (TypeConstructor) resolvedType; ! ! typeVars = MonotypeVar.news(tc.arity()); ! monotype = new MonotypeConstructor(tc, typeVars); if (Types.isPrimitive(tc)) *************** *** 117,121 **** monotype = MonotypeConstructor.apply (nullVars[nullVars.length - 1], monotype); ! cst = new Constraint(nullVars, null); } --- 121,139 ---- monotype = MonotypeConstructor.apply (nullVars[nullVars.length - 1], monotype); ! } ! ! if (nullVars != null || typeVars != null) ! { ! if (nullVars == null) ! cst = new Constraint(typeVars, null); ! else if (typeVars == null) ! cst = new Constraint(nullVars, null); ! else ! { ! TypeSymbol[] binders = new TypeSymbol[nullVars.length + typeVars.length]; ! System.arraycopy(nullVars, 0, binders, 0, nullVars.length); ! System.arraycopy(typeVars, 0, binders, nullVars.length, typeVars.length); ! cst = new Constraint(binders, null); ! } } |