diff options
3 files changed, 17 insertions, 14 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index dabbc842ae..38c90278ed 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -60,7 +60,7 @@ trait Definitions requires SymbolTable { def ScalaObjectClass_tag = getMember(ScalaObjectClass, nme.tag); var AttributeClass: Symbol = _; //var RemoteRefClass: Symbol = _ - var TypedCodeClass: Symbol = _; + //var TypedCodeClass: Symbol = _; var CodeClass: Symbol = _; var CodeModule: Symbol = _; var PartialFunctionClass: Symbol = _; @@ -476,8 +476,10 @@ trait Definitions requires SymbolTable { ScalaObjectClass = getClass("scala.ScalaObject"); AttributeClass = getClass("scala.Attribute"); //RemoteRefClass = getClass("scala.distributed.RemoteRef"); - CodeClass = getClass("scala.reflect.Code"); - CodeModule = getModule("scala.reflect.Code"); + if (!forCLDC) { + CodeClass = getClass("scala.reflect.Code"); + CodeModule = getModule("scala.reflect.Code"); + } PartialFunctionClass = getClass("scala.PartialFunction"); IterableClass = getClass("scala.Iterable"); IteratorClass = getClass("scala.Iterator"); @@ -551,7 +553,7 @@ trait Definitions requires SymbolTable { ObjectRefClass = getClass("scala.runtime.ObjectRef"); SerializableAttr = getClass("scala.serializable"); - BeanPropertyAttr = getClass("scala.reflect.BeanProperty"); + BeanPropertyAttr = if (forCLDC) null else getClass("scala.reflect.BeanProperty"); } } } diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index 7f06291c7c..a5c6abb92a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -197,14 +197,15 @@ trait SyntheticMethods requires Analyzer { // jw-04-2003/jw-0425-designpatterns_p.html) if (!hasImplementation(nme.readResolve)) ts += readResolveMethod; } - for (val sym <- clazz.info.decls.toList) - if (!sym.getAttributes(BeanPropertyAttr).isEmpty) - if (sym.isGetter) - addBeanGetterMethod(sym) - else if (sym.isSetter) - addBeanSetterMethod(sym) - else if (sym.isMethod || sym.isType) - unit.error(sym.pos, "attribute `BeanProperty' is not applicable to " + sym); + if (!forCLDC) + for (val sym <- clazz.info.decls.toList) + if (!sym.getAttributes(BeanPropertyAttr).isEmpty) + if (sym.isGetter) + addBeanGetterMethod(sym) + else if (sym.isSetter) + addBeanSetterMethod(sym) + else if (sym.isMethod || sym.isType) + unit.error(sym.pos, "attribute `BeanProperty' is not applicable to " + sym); } val synthetics = ts.toList; copy.Template( diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 81ac6b0458..68d569bfae 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -926,7 +926,7 @@ trait Typers requires Analyzer { Triple(FunctionClass(fun.vparams.length), fun.vparams map (x => NoType), WildcardType) val Triple(clazz, argpts, respt) = - decompose(if (pt.symbol isSubClass CodeClass) pt.typeArgs.head else pt) + decompose(if (!forCLDC && (pt.symbol isSubClass CodeClass)) pt.typeArgs.head else pt) if (fun.vparams.length != argpts.length) errorTree(fun, "wrong number of parameters; expected = "+argpts.length) @@ -951,7 +951,7 @@ trait Typers requires Analyzer { val funtpe = typeRef(clazz.tpe.prefix, clazz, formals ::: List(restpe)) val fun1 = copy.Function(fun, vparams, checkNoEscaping.locals(context.scope, restpe, body)) .setType(funtpe) - if (pt.symbol isSubClass CodeClass) { + if (!forCLDC && (pt.symbol isSubClass CodeClass)) { val liftPoint = Apply(Select(Ident(CodeModule), nme.lift_), List(fun1)) typed(atPos(fun.pos)(liftPoint)) } else fun1 |