summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-03-10 09:39:58 +0000
committerschinz <schinz@epfl.ch>2005-03-10 09:39:58 +0000
commit5363f24d1db8f73e9f52f100665b19f5b75e356a (patch)
tree75caf344a21e01e160d313e1151199312d37c1c5
parentb52ba308913f45306a054ed4cff861d1d209d1be (diff)
downloadscala-5363f24d1db8f73e9f52f100665b19f5b75e356a.tar.gz
scala-5363f24d1db8f73e9f52f100665b19f5b75e356a.tar.bz2
scala-5363f24d1db8f73e9f52f100665b19f5b75e356a.zip
- renamed "checkCastability" (in Type and subcl...
- renamed "checkCastability" (in Type and subclasses) to "cast", which is nicer and closer to Java 1.5, - renamed "display" to "ancestors" in run-time types
-rw-r--r--sources/scala/Type.java2
-rw-r--r--sources/scala/runtime/types/ScalaClassType.java46
-rw-r--r--sources/scala/runtime/types/Statistics.java20
-rw-r--r--sources/scala/runtime/types/TypeBoolean.java2
-rw-r--r--sources/scala/runtime/types/TypeByte.java2
-rw-r--r--sources/scala/runtime/types/TypeChar.java2
-rw-r--r--sources/scala/runtime/types/TypeConstructor.java14
-rw-r--r--sources/scala/runtime/types/TypeDouble.java2
-rw-r--r--sources/scala/runtime/types/TypeFloat.java2
-rw-r--r--sources/scala/runtime/types/TypeInt.java2
-rw-r--r--sources/scala/runtime/types/TypeLong.java2
-rw-r--r--sources/scala/runtime/types/TypeShort.java2
-rw-r--r--sources/scala/runtime/types/TypeUnit.java2
-rw-r--r--sources/scalac/symtab/Definitions.java10
-rw-r--r--sources/scalac/transformer/TypesAsValuesPhase.java84
-rw-r--r--sources/scalac/util/Names.java2
16 files changed, 98 insertions, 98 deletions
diff --git a/sources/scala/Type.java b/sources/scala/Type.java
index 866e7e244b..26666d59f9 100644
--- a/sources/scala/Type.java
+++ b/sources/scala/Type.java
@@ -66,7 +66,7 @@ abstract public class Type implements java.io.Serializable {
* an exception if this is not possible (implement Scala's
* asInstanceOf operation).
*/
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
if (! (o == null || isInstance(o)))
throw new ClassCastException("\n" + ((ScalaObject)o).getType() + "\n" + this.toString());
return o;
diff --git a/sources/scala/runtime/types/ScalaClassType.java b/sources/scala/runtime/types/ScalaClassType.java
index 220be35463..cc070ac398 100644
--- a/sources/scala/runtime/types/ScalaClassType.java
+++ b/sources/scala/runtime/types/ScalaClassType.java
@@ -21,14 +21,14 @@ public class ScalaClassType extends ClassType {
public static final ScalaClassType[] EMPTY_ARRAY =
new ScalaClassType[0];
- private static final ScalaClassType[][] EMPTY_DISPLAY =
+ private static final ScalaClassType[][] EMPTY_ANCESTOR =
new ScalaClassType[0][];
private final TypeConstructor constr;
private final Type[] inst;
private ScalaClassType[] parents = null;
- private ScalaClassType[][] display = null;
+ private ScalaClassType[][] ancestor = null;
private final int hashCode;
@@ -127,15 +127,15 @@ public class ScalaClassType extends ClassType {
private ScalaClassType myInstantiationFor(ScalaClassType that) {
// Find our instantiation for the other type, if any.
- ScalaClassType[] thisSlice = getDisplay()[that.constr.level];
+ ScalaClassType[] thisSlice = getAncestors()[that.constr.level];
for (int i = 0; i < thisSlice.length; ++i) {
if (thisSlice[i].constr == that.constr) {
- assert Statistics.addDisplaySearchIterations(i + 1);
+ assert Statistics.addAncestorSearchIterations(i + 1);
return thisSlice[i];
}
}
- assert Statistics.addDisplaySearchIterations(thisSlice.length);
+ assert Statistics.addAncestorSearchIterations(thisSlice.length);
return null;
}
@@ -185,35 +185,35 @@ public class ScalaClassType extends ClassType {
return parents;
}
- private ScalaClassType[][] getDisplay() {
- if (display == null)
- computeDisplay();
- return display;
+ private ScalaClassType[][] getAncestors() {
+ if (ancestor == null)
+ computeAncestors();
+ return ancestor;
}
- private void computeDisplay() {
+ private void computeAncestors() {
final int level = constr.level;
- final int[] displayCode = constr.displayCode;
+ final int[] ancestorCode = constr.ancestorCode;
ScalaClassType[] parents = getParents();
- display = new ScalaClassType[level + 1][];
- ScalaClassType[][] initialDisplay = parents.length > 0
- ? parents[0].getDisplay()
- : EMPTY_DISPLAY;
+ ancestor = new ScalaClassType[level + 1][];
+ ScalaClassType[][] initialAncestor = parents.length > 0
+ ? parents[0].getAncestors()
+ : EMPTY_ANCESTOR;
for (int l = 0, dci = 0; l <= level; ++l) {
- int toAddParents = displayCode[dci++];
+ int toAddParents = ancestorCode[dci++];
int toAddSelf = (l == level) ? 1 : 0;
int toAdd = toAddParents + toAddSelf;
ScalaClassType[] initialRow;
- if (l < initialDisplay.length)
- initialRow = initialDisplay[l];
+ if (l < initialAncestor.length)
+ initialRow = initialAncestor[l];
else
initialRow = ScalaClassType.EMPTY_ARRAY;
if (toAdd == 0) {
- display[l] = initialRow;
+ ancestor[l] = initialRow;
} else {
int initialLen = initialRow.length;
ScalaClassType[] newRow =
@@ -224,12 +224,12 @@ public class ScalaClassType extends ClassType {
System.arraycopy(initialRow, 0, newRow, toAddSelf, initialLen);
for (int i = 0; i < toAddParents; ++i) {
- int p = displayCode[dci++];
- int o = displayCode[dci++];
+ int p = ancestorCode[dci++];
+ int o = ancestorCode[dci++];
newRow[toAddSelf + initialLen + i] =
- parents[p].getDisplay()[l][o];
+ parents[p].getAncestors()[l][o];
}
- display[l] = newRow;
+ ancestor[l] = newRow;
}
}
}
diff --git a/sources/scala/runtime/types/Statistics.java b/sources/scala/runtime/types/Statistics.java
index eced2f3b69..3ea2005ded 100644
--- a/sources/scala/runtime/types/Statistics.java
+++ b/sources/scala/runtime/types/Statistics.java
@@ -34,8 +34,8 @@ public class Statistics {
private static long instanceOfCount = 0;
private static long typeCastCount = 0;
- private static long displaySearchIterations = 0;
- private static long displaySearches = 0;
+ private static long ancestorSearchIterations = 0;
+ private static long ancestorSearches = 0;
private static HashMap instances = new HashMap();
@@ -69,9 +69,9 @@ public class Statistics {
return true;
}
- public static synchronized boolean addDisplaySearchIterations(int n) {
- displaySearchIterations += n;
- displaySearches++;
+ public static synchronized boolean addAncestorSearchIterations(int n) {
+ ancestorSearchIterations += n;
+ ancestorSearches++;
return true;
}
@@ -93,11 +93,11 @@ public class Statistics {
+ instanceOfCount + ")");
stream.println("(type-cast . "
+ typeCastCount + ")");
- if (displaySearches > 0) {
- stream.println("(display-searches . "
- + displaySearches + ")");
- stream.println("(display-search-iterations . "
- + displaySearchIterations + ")");
+ if (ancestorSearches > 0) {
+ stream.println("(ancestor-searches . "
+ + ancestorSearches + ")");
+ stream.println("(ancestor-search-iterations . "
+ + ancestorSearchIterations + ")");
}
stream.println("(instances . (");
Iterator instIt = instances.entrySet().iterator();
diff --git a/sources/scala/runtime/types/TypeBoolean.java b/sources/scala/runtime/types/TypeBoolean.java
index 9df80d14dc..520cb7e60c 100644
--- a/sources/scala/runtime/types/TypeBoolean.java
+++ b/sources/scala/runtime/types/TypeBoolean.java
@@ -20,7 +20,7 @@ public class TypeBoolean extends ValueType {
public Array newArray(int size) {
return RunTime.box_zarray(new boolean[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Boolean))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeByte.java b/sources/scala/runtime/types/TypeByte.java
index 542b5b7bd9..7767a89cde 100644
--- a/sources/scala/runtime/types/TypeByte.java
+++ b/sources/scala/runtime/types/TypeByte.java
@@ -20,7 +20,7 @@ public class TypeByte extends ValueType {
public Array newArray(int size) {
return RunTime.box_barray(new byte[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Byte))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeChar.java b/sources/scala/runtime/types/TypeChar.java
index c9c0a86265..c1cf021b99 100644
--- a/sources/scala/runtime/types/TypeChar.java
+++ b/sources/scala/runtime/types/TypeChar.java
@@ -20,7 +20,7 @@ public class TypeChar extends ValueType {
public Array newArray(int size) {
return RunTime.box_carray(new char[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Char))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeConstructor.java b/sources/scala/runtime/types/TypeConstructor.java
index 5c34f130a7..1f48a41f24 100644
--- a/sources/scala/runtime/types/TypeConstructor.java
+++ b/sources/scala/runtime/types/TypeConstructor.java
@@ -52,19 +52,19 @@ public class TypeConstructor implements java.io.Serializable {
public final boolean isTrivial;
/**
- * "Code" to compute the display for an instance of this
- * constructor, based on the display of its parents. This code is
+ * "Code" to compute the ancestors for an instance of this
+ * constructor, based on the ancestors of its parents. This code is
* structured as follows:
*
* n1 p1,1 o1,1 p1,2 o1,2 ... p1,n o1,n n2 p2,1 ... nl pl,1 ol,2 ...
*
* where all n, p and o are integers, and l is the level of this
* constructor. ni gives the number of additional entries to add
- * to the display of the super-class at level i. pi gives the
+ * to the ancestors of the super-class at level i. pi gives the
* index of the parent in which to pick this additional entry, and
- * oi gives the offset of this entry in the parent's display.
+ * oi gives the offset of this entry in the parent's ancestors.
*/
- public final int[] displayCode;
+ public final int[] ancestorCode;
private final InstantiationMap instMapModule = new InstantiationMap();
private final AtomicReference/*<InstantiationMap.T>*/ instances =
@@ -80,7 +80,7 @@ public class TypeConstructor implements java.io.Serializable {
int mCount,
int pCount,
boolean inheritsFromJavaClass,
- int[] displayCode) {
+ int[] ancestorCode) {
this.level = level;
this.outer = outer;
this.zCount = zCount;
@@ -89,7 +89,7 @@ public class TypeConstructor implements java.io.Serializable {
this.isTrivial = (outer == null) && (zCount + pCount + mCount == 0);
- this.displayCode = displayCode;
+ this.ancestorCode = ancestorCode;
try {
this.clazz = Class.forName(fullName, false, loader);
diff --git a/sources/scala/runtime/types/TypeDouble.java b/sources/scala/runtime/types/TypeDouble.java
index 541fdc4cdb..b4066dda26 100644
--- a/sources/scala/runtime/types/TypeDouble.java
+++ b/sources/scala/runtime/types/TypeDouble.java
@@ -19,7 +19,7 @@ public public class TypeDouble extends ValueType {
public Array newArray(int size) {
return RunTime.box_darray(new double[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Double))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeFloat.java b/sources/scala/runtime/types/TypeFloat.java
index 281d8b0fae..cdedfd6c69 100644
--- a/sources/scala/runtime/types/TypeFloat.java
+++ b/sources/scala/runtime/types/TypeFloat.java
@@ -19,7 +19,7 @@ public class TypeFloat extends ValueType {
public Array newArray(int size) {
return RunTime.box_farray(new float[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Float))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeInt.java b/sources/scala/runtime/types/TypeInt.java
index 6959968b17..1e359e73c6 100644
--- a/sources/scala/runtime/types/TypeInt.java
+++ b/sources/scala/runtime/types/TypeInt.java
@@ -20,7 +20,7 @@ public class TypeInt extends ValueType {
public Array newArray(int size) {
return RunTime.box_iarray(new int[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Int))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeLong.java b/sources/scala/runtime/types/TypeLong.java
index 98b621f09a..ab2c10ec95 100644
--- a/sources/scala/runtime/types/TypeLong.java
+++ b/sources/scala/runtime/types/TypeLong.java
@@ -19,7 +19,7 @@ public class TypeLong extends ValueType {
public Array newArray(int size) {
return RunTime.box_larray(new long[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Long))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeShort.java b/sources/scala/runtime/types/TypeShort.java
index c2fb81362c..6597e2a70e 100644
--- a/sources/scala/runtime/types/TypeShort.java
+++ b/sources/scala/runtime/types/TypeShort.java
@@ -19,7 +19,7 @@ public class TypeShort extends ValueType {
public Array newArray(int size) {
return RunTime.box_sarray(new short[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Short))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scala/runtime/types/TypeUnit.java b/sources/scala/runtime/types/TypeUnit.java
index 87fc5d9a22..0628af9e7f 100644
--- a/sources/scala/runtime/types/TypeUnit.java
+++ b/sources/scala/runtime/types/TypeUnit.java
@@ -20,7 +20,7 @@ public class TypeUnit extends ValueType {
public Array newArray(int size) {
return RunTime.box_oarray(new Object[size]);
}
- public Object checkCastability(Object o) {
+ public Object cast(Object o) {
assert scala.runtime.types.Statistics.incTypeCast();
if (! (o == null || o instanceof scala.Unit))
throw new ClassCastException(); // TODO error message
diff --git a/sources/scalac/symtab/Definitions.java b/sources/scalac/symtab/Definitions.java
index 047fcb1329..068590b7ec 100644
--- a/sources/scalac/symtab/Definitions.java
+++ b/sources/scalac/symtab/Definitions.java
@@ -554,11 +554,11 @@ public class Definitions {
return TYPE_ISINSTANCE;
}
- private Symbol TYPE_CHECKCASTABILITY;
- public Symbol TYPE_CHECKCASTABILITY() {
- if (TYPE_CHECKCASTABILITY == null)
- TYPE_CHECKCASTABILITY = loadTerm(TYPE_CLASS, Names.checkCastability);
- return TYPE_CHECKCASTABILITY;
+ private Symbol TYPE_CAST;
+ public Symbol TYPE_CAST() {
+ if (TYPE_CAST == null)
+ TYPE_CAST = loadTerm(TYPE_CLASS, Names.cast);
+ return TYPE_CAST;
}
private Symbol RTT_DOUBLE;
diff --git a/sources/scalac/transformer/TypesAsValuesPhase.java b/sources/scalac/transformer/TypesAsValuesPhase.java
index 89240a6bf3..15cf024513 100644
--- a/sources/scalac/transformer/TypesAsValuesPhase.java
+++ b/sources/scalac/transformer/TypesAsValuesPhase.java
@@ -105,7 +105,7 @@ public class TypesAsValuesPhase extends Phase {
private final Map/*<Symbol, Symbol>*/ predefTypes;
- private HashMap/*<Symbol, Ancestor[][]>*/ displayCache = new HashMap();
+ private HashMap/*<Symbol, Ancestor[][]>*/ ancestorCache = new HashMap();
public TypesAsValuesPhase(Global global, PhaseDescriptor descriptor) {
super(global, descriptor);
@@ -130,7 +130,7 @@ public class TypesAsValuesPhase extends Phase {
membersToAdd.put(defs.ARRAY_CLASS, new NewMember[0]);
paramsToAdd.put(ARRAY_CONSTRUCTOR, new Symbol[0]);
- displayCache.put(defs.OBJECT_CLASS,
+ ancestorCache.put(defs.OBJECT_CLASS,
new Ancestor[][] {
new Ancestor[] {
new Ancestor(defs.OBJECT_CLASS, -1, -1)
@@ -448,7 +448,7 @@ public class TypesAsValuesPhase extends Phase {
// Transform instance tests:
// e.asInstanceOf[T]
// becomes:
- // asValue(T).checkCastability(e).asInstanceOf[T]
+ // asValue(T).cast(e).asInstanceOf[T]
// unless T is a "simple" type for which a Java
// instance test is sufficient, in which case the
// expression is left as is.
@@ -580,8 +580,8 @@ public class TypesAsValuesPhase extends Phase {
++zCount;
}
- Ancestor[][] disp = computeDisplay(clsSym);
- int[] displayCode = getDisplayCode(computeDisplay(clsSym));
+ Ancestor[][] disp = computeAncestors(clsSym);
+ int[] ancestorCode = getAncestorCode(computeAncestors(clsSym));
Tree[] tcArgs = new Tree[] {
gen.mkIntLit(pos, level(clsSym)),
@@ -593,7 +593,7 @@ public class TypesAsValuesPhase extends Phase {
gen.mkIntLit(pos, mCount),
gen.mkIntLit(pos, pCount),
gen.mkBooleanLit(pos, clsSym.parents()[0].symbol().isJava()),
- mkNewIntLitArray(pos, displayCode, owner)
+ mkNewIntLitArray(pos, ancestorCode, owner)
};
Symbol tcConst = defs.TYPECONSTRUCTOR_CLASS.primaryConstructor();
@@ -722,9 +722,9 @@ public class TypesAsValuesPhase extends Phase {
*/
private Tree genTypeCast(int pos, Tree expr, Type tp) {
Tree tpVal = typeAsValue(pos, tp, currentOwner, EENV);
- Tree fun = gen.Select(pos, tpVal, defs.TYPE_CHECKCASTABILITY());
- Tree checkCastCall = gen.mkApply_V(pos, fun, new Tree[] { expr });
- return gen.mkAsInstanceOf(pos, checkCastCall, tp);
+ Tree fun = gen.Select(pos, tpVal, defs.TYPE_CAST());
+ Tree castCall = gen.mkApply_V(pos, fun, new Tree[] { expr });
+ return gen.mkAsInstanceOf(pos, castCall, tp);
}
/**
@@ -927,29 +927,29 @@ public class TypesAsValuesPhase extends Phase {
}
}
- private Ancestor[][] computeDisplay0(Symbol classSym) {
+ private Ancestor[][] computeAncestors0(Symbol classSym) {
Symbol[] scalaParents = scalaParents(classSym);
int level = level(classSym);
- ArrayList/*<Ancestor>*/[] display = new ArrayList[level + 1];
+ ArrayList/*<Ancestor>*/[] ancestor = new ArrayList[level + 1];
- for (int l = 0; l < display.length; ++l)
- display[l] = new ArrayList();
+ for (int l = 0; l < ancestor.length; ++l)
+ ancestor[l] = new ArrayList();
- display[level].add(new Ancestor(classSym, -1, -1));
+ ancestor[level].add(new Ancestor(classSym, -1, -1));
// Go over parents from left to right and add missing
- // ancestors to the display, remembering where they come
+ // ancestors to the ancestor, remembering where they come
// from.
for (int p = 0; p < scalaParents.length; ++p) {
Symbol parentSymbol = scalaParents[p];
assert parentSymbol != Symbol.NONE;
- Ancestor[][] parentDisplay = computeDisplay(parentSymbol);
- assert parentDisplay.length <= display.length;
+ Ancestor[][] parentAncestor = computeAncestors(parentSymbol);
+ assert parentAncestor.length <= ancestor.length;
- for (int l = 0; l < parentDisplay.length; ++l) {
- ArrayList/*<Ancestor>*/ myRow = display[l];
- Ancestor[] parentRow = parentDisplay[l];
+ for (int l = 0; l < parentAncestor.length; ++l) {
+ ArrayList/*<Ancestor>*/ myRow = ancestor[l];
+ Ancestor[] parentRow = parentAncestor[l];
for (int i = 0; i < parentRow.length; ++i) {
Symbol sym = parentRow[i].symbol;
@@ -967,23 +967,23 @@ public class TypesAsValuesPhase extends Phase {
}
}
- Ancestor[][] finalDisplay = new Ancestor[level + 1][];
- for (int i = 0; i < finalDisplay.length; ++i) {
- finalDisplay[i] = (Ancestor[])
- display[i].toArray(new Ancestor[display[i].size()]);
+ Ancestor[][] finalAncestor = new Ancestor[level + 1][];
+ for (int i = 0; i < finalAncestor.length; ++i) {
+ finalAncestor[i] = (Ancestor[])
+ ancestor[i].toArray(new Ancestor[ancestor[i].size()]);
}
- return finalDisplay;
+ return finalAncestor;
}
- private Ancestor[][] computeDisplay(Symbol classSym) {
- Ancestor[][] display = (Ancestor[][])displayCache.get(classSym);
- if (display == null) {
- display = computeDisplay0(classSym);
- displayCache.put(classSym, display);
-// debugPrintDisplay(classSym, display);
+ private Ancestor[][] computeAncestors(Symbol classSym) {
+ Ancestor[][] ancestor = (Ancestor[][])ancestorCache.get(classSym);
+ if (ancestor == null) {
+ ancestor = computeAncestors0(classSym);
+ ancestorCache.put(classSym, ancestor);
+// debugPrintAncestor(classSym, ancestor);
}
- return display;
+ return ancestor;
}
private Symbol[] scalaParents(Symbol classSym) {
@@ -998,12 +998,12 @@ public class TypesAsValuesPhase extends Phase {
scalaParents.toArray(new Symbol[scalaParents.size()]);
}
- private int[] getDisplayCode(Ancestor[][] display) {
+ private int[] getAncestorCode(Ancestor[][] ancestor) {
ArrayList/*<List<Ancestor>>*/ prunedRows = new ArrayList();
int totalSize = 0;
- for (int l = 0; l < display.length; ++l) {
- Ancestor[] row = display[l];
+ for (int l = 0; l < ancestor.length; ++l) {
+ Ancestor[] row = ancestor[l];
ArrayList/*<Ancestor>*/ prunedRow = new ArrayList(row.length);
for (int i = 0; i < row.length; ++i) {
if (row[i].parentIndex > 0)
@@ -1033,16 +1033,16 @@ public class TypesAsValuesPhase extends Phase {
}
// Debugging function
- private void debugPrintDisplay(Symbol sym, Ancestor[][] display) {
- System.out.println("display for " + Debug.show(sym));
- for (int l = 0; l < display.length; ++l) {
+ private void debugPrintAncestor(Symbol sym, Ancestor[][] ancestor) {
+ System.out.println("ancestor for " + Debug.show(sym));
+ for (int l = 0; l < ancestor.length; ++l) {
System.out.print(" [" + l + "] ");
- for (int i = 0; i < display[l].length; ++i) {
+ for (int i = 0; i < ancestor[l].length; ++i) {
if (i > 0)
System.out.print(" ");
- System.out.println(" " + Debug.show(display[l][i].symbol)
- + "/par" + display[l][i].parentIndex
- + "/pos" + display[l][i].position);
+ System.out.println(" " + Debug.show(ancestor[l][i].symbol)
+ + "/par" + ancestor[l][i].parentIndex
+ + "/pos" + ancestor[l][i].position);
}
}
}
diff --git a/sources/scalac/util/Names.java b/sources/scalac/util/Names.java
index ca7dc02c53..43b8953830 100644
--- a/sources/scalac/util/Names.java
+++ b/sources/scalac/util/Names.java
@@ -161,7 +161,7 @@ public class Names {
public static final Name caseArity = Name.fromString("caseArity");
public static final Name caseElement = Name.fromString("caseElement");
public static final Name cur = Name.fromString("cur"); // used in translation of automata
- public static final Name checkCastability = Name.fromString("checkCastability");
+ public static final Name cast = Name.fromString("cast");
public static final Name coerce = Name.fromString("coerce");
public static final Name defaultValue = Name.fromString("defaultValue");
public static final Name elem = Name.fromString("elem");