summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-01-17 14:42:30 +0000
committerschinz <schinz@epfl.ch>2005-01-17 14:42:30 +0000
commit096ab28f3cfcecc1e7746a97161387dd5ee22a8f (patch)
tree36297d5b95132d9f26a8eda8d0bd34fe3a139adf /sources
parentfc1ed2a1889ae284702946fa25406df9f4186888 (diff)
downloadscala-096ab28f3cfcecc1e7746a97161387dd5ee22a8f.tar.gz
scala-096ab28f3cfcecc1e7746a97161387dd5ee22a8f.tar.bz2
scala-096ab28f3cfcecc1e7746a97161387dd5ee22a8f.zip
- removed refinements,
- added inheritsFromJavaClass flag, needed to compute display correctly, - changed instantiate method, to set the parents only after instantiation (needed for classes which inherit from instantiations of themselves)
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/runtime/types/TypeConstructor.java30
1 files changed, 8 insertions, 22 deletions
diff --git a/sources/scala/runtime/types/TypeConstructor.java b/sources/scala/runtime/types/TypeConstructor.java
index 6e15f9a0ef..97a9d2bc0a 100644
--- a/sources/scala/runtime/types/TypeConstructor.java
+++ b/sources/scala/runtime/types/TypeConstructor.java
@@ -55,6 +55,9 @@ public class TypeConstructor {
*/
public final boolean isTrivial;
+ /** True iff this constructor inherits from a Java class */
+ public final boolean inheritsFromJavaClass;
+
/**
* "Code" to compute the display for an instance of this
* constructor, based on the display of its parents. This code is
@@ -70,20 +73,6 @@ public class TypeConstructor {
*/
public final int[] displayCode;
- /**
- * "Code" to compute the refinement for an instance of this
- * constructor, based on the refinement of its parents. This code
- * is structured as follows:
- *
- * n p1 i1 p2 i2 ... pn in
- *
- * where n is the total number of refinements, pi is the index of
- * the parent from which refinement i comes (with -1 indicating
- * the current class) and ii is the index of this refinement in
- * the given parent.
- */
- public final int[] refinementCode;
-
private final InstantiationMap instMapModule = new InstantiationMap();
private final AtomicReference/*<InstantiationMap.T>*/ instances =
new AtomicReference(IOMap.EMPTY);
@@ -97,8 +86,8 @@ public class TypeConstructor {
int zCount,
int mCount,
int pCount,
- int[] displayCode,
- int[] refinementCode) {
+ boolean inheritsFromJavaClass,
+ int[] displayCode) {
this.level = level;
this.fullName = fullName;
this.outer = outer;
@@ -108,8 +97,8 @@ public class TypeConstructor {
this.isTrivial = (outer == null) && (zCount + pCount + mCount == 0);
+ this.inheritsFromJavaClass = inheritsFromJavaClass;
this.displayCode = displayCode;
- this.refinementCode = refinementCode;
try {
this.clazz = Class.forName(fullName, false, loader);
@@ -128,11 +117,8 @@ public class TypeConstructor {
return instMapModule.get((InstantiationMap.T)instances.get(), args);
}
- public ScalaClassType instantiate(Type[] args,
- ScalaClassType[] parents,
- Refinement[] refinement) {
- ScalaClassType tp =
- new ScalaClassType(this, args, parents, refinement);
+ public ScalaClassType instantiate(Type[] args) {
+ ScalaClassType tp = new ScalaClassType(this, args);
try {
InstantiationMap.T oldMap, newMap;