summaryrefslogtreecommitdiff
path: root/sources/scalac/backend/Primitives.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-11-19 09:22:12 +0000
committerpaltherr <paltherr@epfl.ch>2003-11-19 09:22:12 +0000
commit862f5badaa0d8e5761ad1de94366941f498239dd (patch)
treedf635ce3e8885482bca851d37c1b0ae227dca7f9 /sources/scalac/backend/Primitives.java
parentcf31deaa19e8aa39fea15bfedaf7d8870aa96aa6 (diff)
downloadscala-862f5badaa0d8e5761ad1de94366941f498239dd.tar.gz
scala-862f5badaa0d8e5761ad1de94366941f498239dd.tar.bz2
scala-862f5badaa0d8e5761ad1de94366941f498239dd.zip
- Removed inner classes from RunTime
- Added some metadata to RunTime - Adapted Primitives and ErasurePhase to the new metadata
Diffstat (limited to 'sources/scalac/backend/Primitives.java')
-rw-r--r--sources/scalac/backend/Primitives.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/sources/scalac/backend/Primitives.java b/sources/scalac/backend/Primitives.java
index bf1b3de15b..33d420e90b 100644
--- a/sources/scalac/backend/Primitives.java
+++ b/sources/scalac/backend/Primitives.java
@@ -268,7 +268,7 @@ public class Primitives {
this.BOX_FARRAY = getBoxArray(boxes, definitions.FLOAT_TYPE());
this.BOX_DARRAY = getBoxArray(boxes, definitions.DOUBLE_TYPE());
this.BOX_OARRAY = getBoxArray(boxes, definitions.JAVA_OBJECT_TYPE());
- this.BOX__ARRAY = getBoxValue(boxes, definitions.ANY_TYPE());
+ this.BOX__ARRAY = getBoxArray(boxes, definitions.ANY_TYPE());
this.AS_UVALUE = getUniqueTerm(definitions.UNIT_CLASS, AS_UVALUE_N);
this.AS_ZVALUE = getUniqueTerm(definitions.BOOLEAN_CLASS, AS_ZVALUE_N);
this.AS_BVALUE = getUniqueTerm(definitions.DOUBLE_CLASS, AS_BVALUE_N);
@@ -314,13 +314,14 @@ public class Primitives {
private Symbol getBoxValue(Symbol[] alts, Type type) {
for (int i = 0; i < alts.length; i++) {
+ Type result = alts[i].type().resultType();
switch (alts[i].type()) {
- case MethodType(Symbol[] vparams, _):
- if (vparams.length == 1 && vparams[0].type().equals(type))
- return alts[i];
+ case PolyType(Symbol[] tparams, _):
+ result = result.subst(tparams, Symbol.info(tparams));
}
+ if (result.equals(type)) return alts[i];
}
- throw Debug.abort("not found:" + BOX_N + "(" + Debug.show(type) + ")");
+ throw Debug.abort("not found: def " +BOX_N+ "(" +type+ "): " +type);
}
private Symbol getBoxArray(Symbol[] alts, Type type) {