[Nice-commit] Nice/src/bossa/syntax CallExp.java,1.73,1.74
Brought to you by:
bonniot
|
From: <bo...@us...> - 2003-04-02 21:29:45
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv14950/src/bossa/syntax
Modified Files:
CallExp.java
Log Message:
Compute the instanciated domain instead of the instanciated type,
which leads to more precise expected bytecode types for the arguments.
Index: CallExp.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CallExp.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** CallExp.java 1 Mar 2003 00:58:28 -0000 1.73
--- CallExp.java 2 Apr 2003 21:29:40 -0000 1.74
***************
*** 23,26 ****
--- 23,27 ----
import mlsub.typing.Monotype;
import mlsub.typing.FunType;
+ import mlsub.typing.TupleType;
import mlsub.typing.MonotypeConstructor;
import mlsub.typing.Constraint;
***************
*** 266,275 ****
bytecode types.
*/
! instanciatedType = new Polytype
! (type.getConstraint(), new FunType(argTypes, type.getMonotype()));
! instanciatedType = instanciatedType.cloneType();
! // By default, a polytype is suppose to be simplified.
! instanciatedType.setNotSimplified();
! instanciatedType.simplify();
}
--- 267,276 ----
bytecode types.
*/
! instanciatedDomain = new Polytype
! (type.getConstraint(), new TupleType(argTypes));
! instanciatedDomain = instanciatedDomain.cloneType();
! // By default, a polytype is supposed to be simplified.
! instanciatedDomain.setNotSimplified();
! instanciatedDomain.simplify();
}
***************
*** 284,288 ****
/** The type of the function, constrained by the actual arguments. */
! private Polytype instanciatedType;
boolean isAssignable()
--- 285,289 ----
/** The type of the function, constrained by the actual arguments. */
! private Polytype instanciatedDomain;
boolean isAssignable()
***************
*** 326,331 ****
// matching the instantiated type of the (polymorphic) function.
Monotype[] domain = null;
! if (instanciatedType != null)
! domain = Types.domain(instanciatedType);
if (domain != null)
for (int i = 0; i < params.length; i++)
--- 327,332 ----
// matching the instantiated type of the (polymorphic) function.
Monotype[] domain = null;
! if (instanciatedDomain != null)
! domain = ((TupleType) instanciatedDomain.getMonotype()).getComponents();
if (domain != null)
for (int i = 0; i < params.length; i++)
|