[Nice-commit] Nice/stdlib/nice/lang/inline ArrayGetOp.java,1.3,1.4
Brought to you by:
bonniot
|
From: <bo...@us...> - 2003-03-17 20:12:15
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline
In directory sc8-pr-cvs1:/tmp/cvs-serv9380/stdlib/nice/lang/inline
Modified Files:
ArrayGetOp.java
Log Message:
Correctly handle nested tuples involving primitive subtyping.
Index: ArrayGetOp.java
===================================================================
RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/ArrayGetOp.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ArrayGetOp.java 27 Nov 2001 17:57:36 -0000 1.3
--- ArrayGetOp.java 17 Mar 2003 20:11:40 -0000 1.4
***************
*** 36,47 ****
}
public ArrayGetOp(Type type)
{
this.type = type;
! arrayTarget = new StackTarget(nice.tools.code.SpecialTypes.array(type));
}
private final Type type;
! private final StackTarget arrayTarget;
public void compile (ApplyExp exp, Compilation comp, Target target)
--- 36,54 ----
}
+ /**
+ @param type The expected component type of the array, or null to keep
+ it unconstrained.
+ */
public ArrayGetOp(Type type)
{
this.type = type;
! if (type != null)
! arrayTarget = new StackTarget(nice.tools.code.SpecialTypes.array(type));
! else
! arrayTarget = StackTarget.pushObject;
}
private final Type type;
! private final Target arrayTarget;
public void compile (ApplyExp exp, Compilation comp, Target target)
***************
*** 74,78 ****
// If not (possible with polymorphism) the base type is a safe bet
! return type;
}
--- 81,88 ----
// If not (possible with polymorphism) the base type is a safe bet
! if (type != null)
! return type;
!
! return Type.pointer_type;
}
|