Update of /cvsroot/nice/Nice/src/mlsub/typing
In directory sc8-pr-cvs1:/tmp/cvs-serv25333/src/mlsub/typing
Modified Files:
Polytype.java
Log Message:
When a default value is used in a method call, use the declared type of that
parameter to compute the resulting type.
Index: Polytype.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Polytype.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Polytype.java 25 Jul 2003 16:59:23 -0000 1.18
--- Polytype.java 26 Jul 2003 22:29:47 -0000 1.19
***************
*** 49,70 ****
public Polytype cloneType()
{
- Map map = getCloningMap();
- if (map == null)
- return this;
- else
- return cloneType(map);
- }
-
- public Map getCloningMap()
- {
//Optimization
if (isMonomorphic())
! return null;
! return new java.util.HashMap();
! }
- public Polytype cloneType(Map map)
- {
TypeSymbol[] binders = constraint.binders();
TypeSymbol[] newBinders = new TypeSymbol[binders.length];
--- 49,58 ----
public Polytype cloneType()
{
//Optimization
if (isMonomorphic())
! return this;
! Map map = new java.util.HashMap();
TypeSymbol[] binders = constraint.binders();
TypeSymbol[] newBinders = new TypeSymbol[binders.length];
***************
*** 79,91 ****
(new Constraint(newBinders,
AtomicConstraint.substitute(map, constraint.atoms())),
- monotype.substitute(map));
- }
-
- public Polytype applyMap(Map map)
- {
- return new Polytype
- (isMonomorphic() ? Constraint.True
- : new Constraint(constraint.binders(),
- AtomicConstraint.substitute(map, constraint.atoms())),
monotype.substitute(map));
}
--- 67,70 ----
|