diff options
Diffstat (limited to 'sources/scalac/transformer')
8 files changed, 16 insertions, 26 deletions
diff --git a/sources/scalac/transformer/Erasure.java b/sources/scalac/transformer/Erasure.java index 79cfbaacc2..0b5b3b29d8 100644 --- a/sources/scalac/transformer/Erasure.java +++ b/sources/scalac/transformer/Erasure.java @@ -172,11 +172,11 @@ public class Erasure extends Transformer implements Modifiers { fun = transform(fun); vargs = transform(vargs); Symbol symbol = fun.symbol(); - if (symbol == definitions.AS) { + if (symbol == definitions.ANY_AS) { assert targs.length == 1 && vargs.length == 0: tree; return coerce(getQualifier(fun), targs[0].type().erasure()); } - if (symbol == definitions.IS) { + if (symbol == definitions.ANY_IS) { assert targs.length == 1 && vargs.length == 0: tree; Type type = targs[0].type.erasure(); if (isUnboxedSimpleType(type)) type = targs[0].type; diff --git a/sources/scalac/transformer/LambdaLiftPhase.java b/sources/scalac/transformer/LambdaLiftPhase.java index e9b19a3e6e..6919c56364 100644 --- a/sources/scalac/transformer/LambdaLiftPhase.java +++ b/sources/scalac/transformer/LambdaLiftPhase.java @@ -48,7 +48,7 @@ public class LambdaLiftPhase extends Phase implements Kinds, Modifiers { } } if ((sym.flags & Modifiers.CAPTURED) != 0) - return global.definitions.refType(tp1); + return global.definitions.REF_TYPE(tp1); else return tp1; } diff --git a/sources/scalac/transformer/UnCurry.java b/sources/scalac/transformer/UnCurry.java index 488c21e731..88d978fb43 100644 --- a/sources/scalac/transformer/UnCurry.java +++ b/sources/scalac/transformer/UnCurry.java @@ -88,7 +88,7 @@ public class UnCurry extends OwnerTransformer } default: if (tree1.symbol().isDefParameter()) { - tree1.type = global.definitions.functionType( + tree1.type = global.definitions.FUNCTION_TYPE( Type.EMPTY_ARRAY, tree1.type.widen()); return gen.Apply(gen.Select(tree1, global.definitions.FUNCTION_APPLY(0))); } else { @@ -131,7 +131,7 @@ public class UnCurry extends OwnerTransformer case ValDef(_, _, Tree tpe, Tree rhs): if (tree.symbol().isDefParameter()) { - Type newtype = global.definitions.functionType(Type.EMPTY_ARRAY, tpe.type); + Type newtype = global.definitions.FUNCTION_TYPE(Type.EMPTY_ARRAY, tpe.type); Tree tpe1 = gen.mkType(tpe.pos, newtype); return copy.ValDef(tree, tpe1, rhs).setType(newtype); } else { @@ -148,7 +148,7 @@ public class UnCurry extends OwnerTransformer Type ftype = fn.type; Tree fn1 = transform(fn); Tree[] args1 = transformArgs(tree.pos, args, ftype); - if (TreeInfo.methSymbol(fn1) == global.definitions.MATCH && + if (TreeInfo.methSymbol(fn1) == global.definitions.ANY_MATCH && !(args1[0] instanceof Tree.Visitor)) { switch (TreeInfo.methPart(fn1)) { case Select(Tree qual, Name name): diff --git a/sources/scalac/transformer/UnCurryPhase.java b/sources/scalac/transformer/UnCurryPhase.java index ce5bf61287..e8bdc1b77e 100644 --- a/sources/scalac/transformer/UnCurryPhase.java +++ b/sources/scalac/transformer/UnCurryPhase.java @@ -32,7 +32,7 @@ public class UnCurryPhase extends Phase implements Modifiers { */ public Type transformInfo(Symbol sym, Type tp0) { Type tp1 = uncurry(tp0); - if (sym.isDefParameter()) return global.definitions.functionType(Type.EMPTY_ARRAY, tp1); + if (sym.isDefParameter()) return global.definitions.FUNCTION_TYPE(Type.EMPTY_ARRAY, tp1); else return tp1; } diff --git a/sources/scalac/transformer/matching/CodeFactory.java b/sources/scalac/transformer/matching/CodeFactory.java index 832d75fc7b..32af74e511 100644 --- a/sources/scalac/transformer/matching/CodeFactory.java +++ b/sources/scalac/transformer/matching/CodeFactory.java @@ -48,12 +48,12 @@ class CodeFactory extends PatternTool { /** returns `List[ Tuple2[ scala.Int, <elemType> ] ]' */ Type SeqTraceType( Type elemType ) { - return defs.listType(pairType(defs.INT_TYPE(), elemType)); + return defs.LIST_TYPE(pairType(defs.INT_TYPE(), elemType)); } /** returns `Iterator[ elemType ]' */ Type _seqIterType( Type elemType ) { - return defs.iteratorType(elemType); + return defs.ITERATOR_TYPE(elemType); } /** returns `<seqObj.elements>' */ @@ -183,7 +183,7 @@ class CodeFactory extends PatternTool { } protected Tree Equals(Tree left, Tree right) { - Symbol fun = unit.global.definitions.EQEQ; + Symbol fun = unit.global.definitions.ANY_EQEQ; return gen.mkApply_V(gen.Select(left, fun), new Tree[]{right}); } @@ -199,7 +199,7 @@ class CodeFactory extends PatternTool { Type pairType( Type left, Type right ) { - return defs.tupleType(new Type[] { left, right } ); + return defs.TUPLE_TYPE(new Type[] { left, right } ); } Tree newPair( Tree left, Tree right ) { diff --git a/sources/scalac/transformer/matching/LeftTracerInScala.java b/sources/scalac/transformer/matching/LeftTracerInScala.java index d85d4b2e37..fec2d4dc9a 100644 --- a/sources/scalac/transformer/matching/LeftTracerInScala.java +++ b/sources/scalac/transformer/matching/LeftTracerInScala.java @@ -48,7 +48,7 @@ public class LeftTracerInScala extends TracerInScala { .toString() ), owner, 0) - .setType( defs.listType( elementType ) ) ; + .setType( defs.LIST_TYPE( elementType ) ) ; helpMap.put( realVar, helpVar ); @@ -65,11 +65,11 @@ public class LeftTracerInScala extends TracerInScala { cf.fresh.newName(Name.fromString( helpName )), owner, 0) - .setType( defs.listType( pat.type() )) ; + .setType( defs.LIST_TYPE( pat.type() )) ; Tree varDef = gen.ValDef( helpVar, gen.mkDefaultValue( cf.pos, - defs.listType( pat.type() )) + defs.LIST_TYPE( pat.type() )) //cf.ignoreValue( ) ); helpVarDefs.add( varDef ); diff --git a/sources/scalac/transformer/matching/PatternTool.java b/sources/scalac/transformer/matching/PatternTool.java index a34a53334e..c1e3c73483 100644 --- a/sources/scalac/transformer/matching/PatternTool.java +++ b/sources/scalac/transformer/matching/PatternTool.java @@ -20,16 +20,6 @@ import scalac.symtab.*; abstract class PatternTool { public static final Name RESULT_N = Name.fromString("$result"); - public static final Name SCALA_N = Name.fromString("scala"); - public static final Name BOOLEAN_N = Name.fromString("Boolean"); - public static final Name AND_N = Name.fromString("$amp$amp"); - public static final Name OR_N = Name.fromString("$bar$bar"); - public static final Name EQUALS_N = Name.fromString("$eq$eq"); - public static final Name SCALA_MATCHERROR_N = Name.fromString("scala.MatchError"); - public static final Name MATCHERROR_N = Name.fromString("MatchError"); - public static final Name FAIL_N = Name.fromString("fail"); - public static final Name LENGTH_N = Name.fromString("length"); - public static final Name APPLY_N = Name.fromString("apply"); /** the current compilation unit */ diff --git a/sources/scalac/transformer/matching/RightTracerInScala.java b/sources/scalac/transformer/matching/RightTracerInScala.java index 91d84091af..3f84b33aaf 100644 --- a/sources/scalac/transformer/matching/RightTracerInScala.java +++ b/sources/scalac/transformer/matching/RightTracerInScala.java @@ -108,7 +108,7 @@ public class RightTracerInScala extends TracerInScala { if( keepType ) helpVar.setType( realVar.type() ); else - helpVar.setType( defs.listType(elementType) ); + helpVar.setType( defs.LIST_TYPE(elementType) ); helpMap.put( realVar, helpVar ); @@ -291,7 +291,7 @@ public class RightTracerInScala extends TracerInScala { for( Iterator it = helpMap3.keySet().iterator(); it.hasNext(); ) { Symbol vsym = (Symbol) it.next(); Symbol hv = (Symbol) helpMap3.get( vsym ); - hv.setType( defs.listType( elementType ) ) ; + hv.setType( defs.LIST_TYPE( elementType ) ) ; Tree refv = gen.Ident(Position.FIRSTPOS, vsym); Tree refhv = gen.Ident(Position.FIRSTPOS, hv); res[ j++ ] = gen.Assign( refhv, refv ); |