Fixed deprecation warnings in the backend.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@12306 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
fb7b7d48d8
commit
c41bcc1413
|
@ -492,9 +492,9 @@ abstract class GenICode extends SubComponent {
|
|||
|
||||
var handlers = for (CaseDef(pat, _, body) <- catches.reverse)
|
||||
yield pat match {
|
||||
case Typed(Ident(nme.WILDCARD), tpt) => (tpt.tpe.symbol, kind, {
|
||||
case Typed(Ident(nme.WILDCARD), tpt) => (tpt.tpe.typeSymbol, kind, {
|
||||
ctx: Context =>
|
||||
ctx.bb.emit(DROP(REFERENCE(tpt.tpe.symbol)));
|
||||
ctx.bb.emit(DROP(REFERENCE(tpt.tpe.typeSymbol)));
|
||||
val ctx1 = genLoad(body, ctx, kind);
|
||||
if (guardResult) {
|
||||
ctx1.bb.emit(STORE_LOCAL(tmp))
|
||||
|
@ -521,7 +521,7 @@ abstract class GenICode extends SubComponent {
|
|||
case Bind(name, _) =>
|
||||
val exception = ctx.method.addLocal(new Local(pat.symbol, toTypeKind(pat.symbol.tpe), false))
|
||||
|
||||
(pat.symbol.tpe.symbol, kind, {
|
||||
(pat.symbol.tpe.typeSymbol, kind, {
|
||||
ctx: Context =>
|
||||
if (settings.Xdce.value)
|
||||
ctx.bb.emit(LOAD_EXCEPTION(), pat.pos)
|
||||
|
@ -619,7 +619,7 @@ abstract class GenICode extends SubComponent {
|
|||
assert(false) /* Erasure should have added an unboxing operation to prevent that. */
|
||||
}
|
||||
else if (r.isValueType)
|
||||
ctx.bb.emit(IS_INSTANCE(REFERENCE(definitions.boxedClass(r.toType.symbol))))
|
||||
ctx.bb.emit(IS_INSTANCE(REFERENCE(definitions.boxedClass(r.toType.typeSymbol))))
|
||||
else
|
||||
genCast(l, r, ctx1, cast);
|
||||
|
||||
|
@ -822,8 +822,8 @@ abstract class GenICode extends SubComponent {
|
|||
|
||||
val hostClass = fun match {
|
||||
case Select(qualifier, _)
|
||||
if (qualifier.tpe.symbol != definitions.ArrayClass) =>
|
||||
qualifier.tpe.symbol
|
||||
if (qualifier.tpe.typeSymbol != definitions.ArrayClass) =>
|
||||
qualifier.tpe.typeSymbol
|
||||
case _ => sym.owner
|
||||
}
|
||||
if (settings.debug.value && hostClass != sym.owner)
|
||||
|
@ -1433,8 +1433,8 @@ abstract class GenICode extends SubComponent {
|
|||
else ((sym isNonBottomSubClass definitions.BoxedNumberClass) ||
|
||||
(!forMSIL && (sym isNonBottomSubClass BoxedCharacterClass)))
|
||||
|
||||
val lsym = l.tpe.symbol
|
||||
val rsym = r.tpe.symbol
|
||||
val lsym = l.tpe.typeSymbol
|
||||
val rsym = r.tpe.typeSymbol
|
||||
(lsym == definitions.ObjectClass) ||
|
||||
(rsym == definitions.ObjectClass) ||
|
||||
(lsym != rsym) && (isBoxed(lsym) || isBoxed(rsym))
|
||||
|
|
|
@ -93,7 +93,7 @@ trait TypeKinds { self: ICodes =>
|
|||
def lub(a: TypeKind, b: TypeKind): TypeKind = {
|
||||
def lub0(t1: Type, t2: Type): Type = {
|
||||
val lubTpe = global.lub(t1 :: t2 :: Nil)
|
||||
assert(lubTpe.symbol.isClass,
|
||||
assert(lubTpe.typeSymbol.isClass,
|
||||
"Least upper bound of " + t1 + " and " + t2 + " is not a class: " + lubTpe)
|
||||
lubTpe
|
||||
}
|
||||
|
|
|
@ -165,13 +165,13 @@ abstract class GenJVM extends SubComponent {
|
|||
|
||||
if (parents.length > 1) {
|
||||
ifaces = new Array[String](parents.length - 1)
|
||||
parents.drop(1).map((s) => javaName(s.symbol)).copyToArray(ifaces, 0)
|
||||
parents.drop(1).map((s) => javaName(s.typeSymbol)).copyToArray(ifaces, 0)
|
||||
()
|
||||
}
|
||||
|
||||
jclass = fjbgContext.JClass(javaFlags(c.symbol),
|
||||
name,
|
||||
javaName(parents(0).symbol),
|
||||
javaName(parents(0).typeSymbol),
|
||||
ifaces,
|
||||
c.cunit.source.toString)
|
||||
|
||||
|
@ -220,7 +220,7 @@ abstract class GenJVM extends SubComponent {
|
|||
for (val AnnotationInfo(ThrowsAttr, List(exc), _) <- excs.removeDuplicates) {
|
||||
buf.putShort(
|
||||
cpool.addClass(
|
||||
javaName(exc.constant.get.typeValue.symbol)).shortValue)
|
||||
javaName(exc.constant.get.typeValue.typeSymbol)).shortValue)
|
||||
nattr = nattr + 1
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ abstract class GenJVM extends SubComponent {
|
|||
|
||||
for (attrib@AnnotationInfo(typ, consts, nvPairs) <- attributes;
|
||||
if attrib.isConstant;
|
||||
if typ.symbol isNonBottomSubClass definitions.ClassfileAnnotationClass) {
|
||||
if typ.typeSymbol isNonBottomSubClass definitions.ClassfileAnnotationClass) {
|
||||
nattr = nattr + 1
|
||||
val jtype = javaType(typ)
|
||||
buf.putShort(cpool.addUtf8(jtype.getSignature()).toShort)
|
||||
|
@ -319,7 +319,7 @@ abstract class GenJVM extends SubComponent {
|
|||
val attributes = for (attrs <- pattrss) yield
|
||||
for (attr @ AnnotationInfo(tpe, _, _) <- attrs;
|
||||
if attr.isConstant;
|
||||
if tpe.symbol isNonBottomSubClass definitions.ClassfileAnnotationClass) yield attr;
|
||||
if tpe.typeSymbol isNonBottomSubClass definitions.ClassfileAnnotationClass) yield attr;
|
||||
if (attributes.forall(_.isEmpty)) return;
|
||||
|
||||
val buf: ByteBuffer = ByteBuffer.allocate(2048)
|
||||
|
@ -804,13 +804,13 @@ abstract class GenJVM extends SubComponent {
|
|||
}
|
||||
|
||||
case BOX(kind) =>
|
||||
val boxedType = definitions.boxedClass(kind.toType.symbol)
|
||||
val boxedType = definitions.boxedClass(kind.toType.typeSymbol)
|
||||
val mtype = new JMethodType(javaType(boxedType), Array(javaType(kind)))
|
||||
jcode.emitINVOKESTATIC(BoxesUtility, "boxTo" + boxedType.nameString, mtype)
|
||||
|
||||
case UNBOX(kind) =>
|
||||
val mtype = new JMethodType(javaType(kind), Array(JObjectType.JAVA_LANG_OBJECT))
|
||||
jcode.emitINVOKESTATIC(BoxesUtility, "unboxTo" + kind.toType.symbol.nameString, mtype)
|
||||
jcode.emitINVOKESTATIC(BoxesUtility, "unboxTo" + kind.toType.typeSymbol.nameString, mtype)
|
||||
|
||||
case NEW(REFERENCE(cls)) =>
|
||||
val className = javaName(cls)
|
||||
|
|
Loading…
Reference in New Issue